Compulsory education, duration (years)
Real data: World Bank, World Development Indicators, indicator SE.COM.DURS, retrieved 19 November 2026. Values are as published; we only reshaped the file.
What it measures
Duration of compulsory education is the number of years that children are legally obliged to attend school.
Limits and exceptions (World Bank note)
The presence of national legislation does not guarantee that countries will implement it effectively, nor does it ensure that parents will take advantage of the provisions available for their children.
The numbers in 2025
In 2025, 197 countries have a value. The highest is Venezuela, RB (17); at the bottom, 2 countries tie at 0 (e.g. Guam, New Caledonia). The median country value is 10. The World Bank's World aggregate for 2025 is 10.
Top 10 countries, 2025
years
Highest, 2025
| # | Country | Value |
|---|---|---|
| 1 | Venezuela, RB | 17 |
| 2 | Guatemala | 16 |
| 3 | Dominican Republic | 15 |
| 4 | Ecuador | 15 |
| 5 | El Salvador | 15 |
| 6 | Israel | 15 |
| 7 | Tonga | 15 |
| 8 | Argentina | 14 |
| 9 | Bolivia | 14 |
| 10 | Brazil | 14 |
Lowest, 2025
Ties are listed A to Z.
| # | Country | Value |
|---|---|---|
| 1 | New Caledonia | 0 |
| 2 | Guam | 0 |
| 3 | Myanmar | 5 |
| 4 | Madagascar | 5 |
| 5 | Bangladesh | 5 |
| 6 | Suriname | 6 |
| 7 | Singapore | 6 |
| 8 | Sao Tome and Principe | 6 |
| 9 | Rwanda | 6 |
| 10 | Malaysia | 6 |
How many countries report, by decade
| Decade | Most countries in one year |
|---|---|
| 1970s | 1 |
| 1980s | 1 |
| 1990s | 162 |
| 2000s | 186 |
| 2010s | 196 |
| 2020s | 197 |
World aggregate by year
As published by the World Bank (in the regions file, not the country file).
| Year | World |
|---|---|
| 2025 | 10 |
| 2024 | 10 |
| 2023 | 10 |
| 2022 | 10 |
| 2021 | 10 |
| 2020 | 10 |
| 2019 | 10 |
| 2018 | 10 |
| 2017 | 10 |
| 2016 | 10 |
| 2015 | 10 |
| 2014 | 9 |
By region, 2025
| World Bank region | Value |
|---|---|
| Latin America & Caribbean | 13 |
| Europe & Central Asia | 11 |
| North America | 11 |
| Middle East, North Africa, Afghanistan & Pakistan | 9.5 |
| East Asia & Pacific | 9 |
| South Asia | 8.5 |
| Sub-Saharan Africa | 8 |
First rows
compulsory-education-duration-years.csv
| countrytext | iso3text | regiontext | income_grouptext | yearnumber | valuenumber |
|---|---|---|---|---|---|
| Afghanistan | AFG | Middle East, North Africa, Afghanistan & Pakistan | Low income | 1998 | 6 |
| Afghanistan | AFG | Middle East, North Africa, Afghanistan & Pakistan | Low income | 1999 | 6 |
| Afghanistan | AFG | Middle East, North Africa, Afghanistan & Pakistan | Low income | 2000 | 6 |
| Afghanistan | AFG | Middle East, North Africa, Afghanistan & Pakistan | Low income | 2001 | 6 |
| Afghanistan | AFG | Middle East, North Africa, Afghanistan & Pakistan | Low income | 2002 | 6 |
| Afghanistan | AFG | Middle East, North Africa, Afghanistan & Pakistan | Low income | 2003 | 6 |
| Afghanistan | AFG | Middle East, North Africa, Afghanistan & Pakistan | Low income | 2004 | 6 |
| Afghanistan | AFG | Middle East, North Africa, Afghanistan & Pakistan | Low income | 2005 | 6 |
Data dictionary
| Column | Type | Meaning |
|---|---|---|
| country | text | Country or economy, World Bank name |
| iso3 | text | ISO 3166-1 alpha-3 code |
| region | text | World Bank region |
| income_group | text | World Bank income group |
| year | number | Calendar year of the value |
| value | number | Compulsory education, duration (years), exactly as the World Bank API returns it (not rounded) |
Only country-years with a value are in the long file; blank cells in the wide file mean no value was published.
Practice questions
answers computed from the file
Which country has the highest value in 2025?
Venezuela, RB, with 17.
Excel (on the long CSV: E = year, F = value)
=FILTER(A2:A100000,(E2:E100000=2025)*(F2:F100000=MAXIFS(F2:F100000,E2:E100000,2025)))SQL (table wb = the CSV)
SELECT country, value FROM wb WHERE year = 2025
AND value = (SELECT MAX(value) FROM wb WHERE year = 2025);pandas (df = pd.read_csv("compulsory-education-duration-years.csv"))
y = df[df.year == 2025]
y[y.value == y.value.max()][["country", "value"]]File: compulsory-education-duration-years.csv
How many countries report a value for 2025?
197 of the 217 economies in the file's country list.
Excel (on the long CSV: E = year, F = value)
=COUNTIF(E2:E100000,2025)SQL (table wb = the CSV)
SELECT COUNT(*) FROM wb WHERE year = 2025;pandas (df = pd.read_csv("compulsory-education-duration-years.csv"))
(df.year == 2025).sum()File: compulsory-education-duration-years.csv
What is the median across countries in 2025?
10 (median of the 197 country values; not a World Bank aggregate).
Excel (on the long CSV: E = year, F = value)
=MEDIAN(FILTER(F2:F100000,E2:E100000=2025))SQL (table wb = the CSV)
-- SQLite has no MEDIAN(); this picks the middle value(s)
SELECT AVG(value) FROM (SELECT value FROM wb WHERE year = 2025 ORDER BY value
LIMIT 2 - (SELECT COUNT(*) FROM wb WHERE year = 2025) % 2
OFFSET (SELECT (COUNT(*) - 1) / 2 FROM wb WHERE year = 2025));pandas (df = pd.read_csv("compulsory-education-duration-years.csv"))
df[df.year == 2025]["value"].median()File: compulsory-education-duration-years.csv
Which country rose the most between 2015 and 2025?
Maldives: from 7 to 12, a rise of 5 (out of 193 countries with both years).
Excel (on the long CSV: E = year, F = value)
Use the wide file (compulsory-education-duration-years-wide.csv): add a column = [2025] - [2015], then sort it largest to smallest.SQL (table wb = the CSV)
SELECT a.country, b.value - a.value AS rise FROM wb a JOIN wb b ON a.iso3 = b.iso3
WHERE a.year = 2015 AND b.year = 2025 ORDER BY rise DESC LIMIT 1;pandas (df = pd.read_csv("compulsory-education-duration-years.csv"))
w = df.pivot(index="country", columns="year", values="value")
(w[2025] - w[2015]).dropna().nlargest(1)File: compulsory-education-duration-years.csv
Which year has the most countries reporting?
2025, with 197 countries.
Excel (on the long CSV: E = year, F = value)
Make a pivot table: year in Rows, Count of value in Values, then sort by the count.SQL (table wb = the CSV)
SELECT year, COUNT(*) AS n FROM wb GROUP BY year ORDER BY n DESC, year DESC LIMIT 1;pandas (df = pd.read_csv("compulsory-education-duration-years.csv"))
df.groupby("year").size().sort_values(ascending=False).head(1)File: compulsory-education-duration-years.csv