DataBrighten

    Compulsory education, duration (years)

    5,218 × 6rows × columns: 197 countries, 1975 to 2025

    Real data: World Bank, World Development Indicators, indicator SE.COM.DURS, retrieved 19 November 2026. Values are as published; we only reshaped the file.

    textnumberdateyes/no
    Rows5,218country-year values
    Countries197with at least one value
    Years1975 – 202551 years with data
    LicenceCC BY 4.0credit the World Bank

    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

    Source: World Bank, SE.COM.DURS, retrieved 19 November 2026. Computed from compulsory-education-duration-years.csv.

    Highest, 2025

    #CountryValue
    1Venezuela, RB17
    2Guatemala16
    3Dominican Republic15
    4Ecuador15
    5El Salvador15
    6Israel15
    7Tonga15
    8Argentina14
    9Bolivia14
    10Brazil14

    Lowest, 2025

    Ties are listed A to Z.

    #CountryValue
    1New Caledonia0
    2Guam0
    3Myanmar5
    4Madagascar5
    5Bangladesh5
    6Suriname6
    7Singapore6
    8Sao Tome and Principe6
    9Rwanda6
    10Malaysia6
    How many countries report, by decade
    DecadeMost countries in one year
    1970s1
    1980s1
    1990s162
    2000s186
    2010s196
    2020s197

    World aggregate by year

    As published by the World Bank (in the regions file, not the country file).

    YearWorld
    202510
    202410
    202310
    202210
    202110
    202010
    201910
    201810
    201710
    201610
    201510
    20149

    By region, 2025

    World Bank regionValue
    Latin America & Caribbean 13
    Europe & Central Asia11
    North America11
    Middle East, North Africa, Afghanistan & Pakistan9.5
    East Asia & Pacific9
    South Asia8.5
    Sub-Saharan Africa 8

    First rows

    compulsory-education-duration-years.csv

    countrytextiso3textregiontextincome_grouptextyearnumbervaluenumber
    AfghanistanAFGMiddle East, North Africa, Afghanistan & PakistanLow income19986
    AfghanistanAFGMiddle East, North Africa, Afghanistan & PakistanLow income19996
    AfghanistanAFGMiddle East, North Africa, Afghanistan & PakistanLow income20006
    AfghanistanAFGMiddle East, North Africa, Afghanistan & PakistanLow income20016
    AfghanistanAFGMiddle East, North Africa, Afghanistan & PakistanLow income20026
    AfghanistanAFGMiddle East, North Africa, Afghanistan & PakistanLow income20036
    AfghanistanAFGMiddle East, North Africa, Afghanistan & PakistanLow income20046
    AfghanistanAFGMiddle East, North Africa, Afghanistan & PakistanLow income20056

    Data dictionary

    ColumnTypeMeaning
    countrytextCountry or economy, World Bank name
    iso3textISO 3166-1 alpha-3 code
    regiontextWorld Bank region
    income_grouptextWorld Bank income group
    yearnumberCalendar year of the value
    valuenumberCompulsory 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