What makes an African city a happy place to live? Pleasant weather helps, but residents also face questions about housing costs, healthcare, pollution, commuting and purchasing power.

In 2026, two different studies offered perspectives on urban well-being. Time Out's global happiness survey placed Cape Town eighth worldwide, making it the only African city in its published top 20. Meanwhile, Numbeo's Africa Quality of Life Index compared 12 cities using several indicators of everyday living conditions.

The two studies measure different things. Time Out asked residents about their happiness, while Numbeo measured reported quality-of-life conditions. The following ranking uses Numbeo's published 2026 scores, not a direct happiness survey.

1. Gqeberha, South Africa — 161.9

Listed as Port Elizabeth in Numbeo's dataset, Gqeberha recorded the highest quality-of-life score among the African cities covered.

The Eastern Cape coastal city scored particularly well for climate, with a climate index of 98.8. Its property-price-to-income ratio was also comparatively low at 2.0.

However, its safety index was only 21.4, showing that a strong overall quality-of-life score does not mean residents experience uniformly favourable conditions.

2. Cape Town, South Africa — 160.4

Cape Town finished narrowly behind Gqeberha, with a quality-of-life score of 160.4.

The city recorded a climate index of 98.2 and a healthcare index of 68.9, the highest healthcare score among the cities listed.

Cape Town also gained international attention in Time Out's 2026 happiness survey, finishing eighth globally. Its mountains, beaches and cultural attractions are major strengths, although inequality, crime and housing affordability remain significant challenges.

3. Windhoek, Namibia — 157.8

Namibia's capital recorded 157.8 points, placing it third in the Numbeo African comparison.

Windhoek's reported traffic commute index of 23.7 was lower than that of every other city in the dataset, suggesting relatively favourable commuting conditions.

The city also recorded a healthcare index of 67.4 and a climate index of 85.0. Its safety score, however, was only 32.4.

4. Durban, South Africa — 151.8

Durban ranked fourth with 151.8 points.

The Indian Ocean city received a climate index of 95.6 and a purchasing power index of 104.1. Its warm coastal environment is one of its defining characteristics.

Durban's safety index was 19.6, illustrating the gap between its favourable climate and its reported public-safety conditions.

5. Pretoria, South Africa — 143.5

Pretoria scored 143.5 in the 2026 index.

The administrative capital recorded a climate score of 95.8, a healthcare index of 66.5 and a relatively low property-price-to-income ratio of 2.6.

Its safety index was 18.2, the lowest among the South African cities included in the ranking.

6. Johannesburg, South Africa — 140.5

Johannesburg received 140.5 points, placing it sixth among the African cities surveyed.

Its purchasing power index reached 111.7, higher than Cape Town, Durban and Pretoria. This reflects comparatively strong reported purchasing power within Numbeo's dataset.

However, Johannesburg's pollution index stood at 61.9, while its safety index was 19.2.

7. Tunis, Tunisia — 109.9

Tunis was the highest-ranked North African city in the published comparison, with 109.9 points.

The Tunisian capital recorded a safety index of 51.5 and a climate index of 93.2.

Its purchasing power index of 38.5 was considerably lower than those of the South African cities above it, affecting its overall position.

8. Nairobi, Kenya — 95.5

Kenya's capital recorded a quality-of-life score of 95.5, narrowly ahead of Casablanca.

Nairobi achieved a healthcare index of 63.2 and an exceptionally high climate index of 99.8, the highest among the cities included.

However, its traffic commute index reached 53.7, while its property-price-to-income ratio stood at 14.6.

9. Casablanca, Morocco — 95.4

Casablanca followed Nairobi by just 0.1 points.

Morocco's commercial capital recorded a climate index of 98.1 and a safety index of 45.0.

Its pollution index reached 82.1, while the property-price-to-income ratio stood at 15.0, reflecting significant challenges in the reported living conditions.

10. Alexandria, Egypt — 88.2

Alexandria scored 88.2, placing it tenth.

Egypt's Mediterranean port city recorded a safety index of 54.6, the highest in the African comparison.

However, its purchasing power index was only 19.2, and its property-price-to-income ratio reached 23.5.

11. Cairo, Egypt — 76.9

Cairo recorded 76.9 points.

The Egyptian capital had a climate index of 88.5 and a safety index of 50.0. Its pollution index reached 90.6, while reported traffic commute time remained relatively high.

12. Lagos, Nigeria — 0.0

Lagos appeared last in the published dataset with a quality-of-life index of 0.0.

That figure should not be interpreted as proof that residents have zero quality of life or happiness. Numbeo's composite methodology, data coverage and reported inputs affect the published score.

Lagos recorded a traffic commute index of 68.3 and a pollution index of 88.5, reflecting difficult urban conditions within the dataset.

Methodology

The ranking reproduces the ordering of Numbeo's Africa Quality of Life Index by City 2026, covering 12 listed cities. Scores combine reported purchasing power, safety, healthcare, housing affordability, commuting, pollution and climate.

Numbeo relies substantially on user-contributed data, and its city coverage is incomplete. This is therefore a ranking of the cities included in that dataset, not every African city.

It is also not a direct measurement of happiness. Time Out's separate 2026 resident survey provides a direct happiness measure and identifies Cape Town as a global top-10 city.