{
  "name": "electricity-mix",
  "title": "Electricity Generation Mix by Country and Source (Ember)",
  "description": "Yearly electricity generation by source (coal, gas, other fossil, nuclear, hydro, wind, solar, bioenergy, other renewables) in terawatt-hours and as a share of total generation, for 209 countries and economies and 15 aggregates including the World, from Ember's Yearly Electricity Data. Most countries from 2000, some from 1985. In Ember's release of 17 November 2026 the latest year is 2025, with 95 countries plus the aggregates. Updated monthly from Ember. Three tables: generation by area, year and source (long); one row per area and year with totals, demand, net imports, shares and the largest source (wide); and the list of areas with country/region flag, continent and groupings. Source: Ember, Yearly Electricity Data (CC BY 4.0).",
  "status": "monitored",
  "licenses": [
    {
      "name": "CC-BY-4.0",
      "title": "Creative Commons Attribution 4.0. Ember: “Ember content is released under a Creative Commons Attribution Licence (CC-BY-4.0) This means you’re free to share and adapt our work – as long as you credit us.” Credit: Ember, Yearly Electricity Data.",
      "path": "https://ember-energy.org/creative-commons/"
    }
  ],
  "sources": [
    {
      "title": "Ember, Yearly Electricity Data (global CSV download, release_generation_yearly_global.csv)",
      "path": "https://ember-energy.org/data/yearly-electricity-data/"
    },
    {
      "title": "Ember, Electricity Data Methodology (PDF)",
      "path": "https://files.ember-energy.org/public-downloads/ember_electricity_data_methodology.pdf"
    }
  ],
  "upkeep": {
    "mode": "living",
    "refresh": "monthly",
    "workflow": ".github/workflows/update.yml"
  },
  "resources": [
    {
      "path": "data/generation.csv",
      "name": "generation",
      "title": "Electricity generation by area, year and source (TWh and share)",
      "mediatype": "text/csv",
      "format": "csv",
      "encoding": "utf-8",
      "schema": {
        "fields": [
          {
            "name": "area",
            "type": "string",
            "description": "Ember's area name: a country or economy (e.g. United States, Türkiye, Taiwan (China), Kosovo) or one of Ember's aggregates (World, continents, EU, OECD, G7, G20, ASEAN, AU, MENA and others). See areas.csv."
          },
          {
            "name": "iso3_code",
            "type": "string",
            "description": "ISO 3166-1 alpha-3 code for countries (Ember's; XKX for Kosovo); empty for regions."
          },
          {
            "name": "area_type",
            "type": "string",
            "description": "country (Ember's 'Country or economy') or region (an aggregate such as World, EU or Africa). Filter on this so aggregates are not added to countries.",
            "constraints": {
              "enum": [
                "country",
                "region"
              ]
            }
          },
          {
            "name": "year",
            "type": "integer",
            "description": "Calendar year. Most areas from 2000; 22 countries from 1985 and 30 more from 1990. The latest year is partly estimated by Ember from monthly data, and regional and World figures for it include Ember's estimates for countries without data."
          },
          {
            "name": "source",
            "type": "string",
            "description": "Generation source: coal (Coal); gas (Gas); other_fossil (Other fossil fuels (oil and other fossil)); nuclear (Nuclear); hydro (Hydro); wind (Wind); solar (Solar); bioenergy (Bioenergy); other_renewables (Other renewables (geothermal, tidal and wave)).",
            "constraints": {
              "enum": [
                "coal",
                "gas",
                "other_fossil",
                "nuclear",
                "hydro",
                "wind",
                "solar",
                "bioenergy",
                "other_renewables"
              ]
            }
          },
          {
            "name": "generation_twh",
            "type": "number",
            "description": "Electricity generated from this source in the year, terawatt-hours (TWh), as published by Ember."
          },
          {
            "name": "share_pct",
            "type": "number",
            "description": "Share of the area's total electricity generation in the year from this source, percent, as published by Ember."
          }
        ],
        "primaryKey": [
          "area",
          "year",
          "source"
        ]
      }
    },
    {
      "path": "data/summary.csv",
      "name": "summary",
      "title": "Electricity mix by area and year: totals, shares by source and largest source",
      "mediatype": "text/csv",
      "format": "csv",
      "encoding": "utf-8",
      "schema": {
        "fields": [
          {
            "name": "area",
            "type": "string",
            "description": "Ember's area name: a country or economy (e.g. United States, Türkiye, Taiwan (China), Kosovo) or one of Ember's aggregates (World, continents, EU, OECD, G7, G20, ASEAN, AU, MENA and others). See areas.csv."
          },
          {
            "name": "iso3_code",
            "type": "string",
            "description": "ISO 3166-1 alpha-3 code for countries (Ember's; XKX for Kosovo); empty for regions."
          },
          {
            "name": "area_type",
            "type": "string",
            "description": "country (Ember's 'Country or economy') or region (an aggregate such as World, EU or Africa). Filter on this so aggregates are not added to countries.",
            "constraints": {
              "enum": [
                "country",
                "region"
              ]
            }
          },
          {
            "name": "year",
            "type": "integer",
            "description": "Calendar year. Most areas from 2000; 22 countries from 1985 and 30 more from 1990. The latest year is partly estimated by Ember from monthly data, and regional and World figures for it include Ember's estimates for countries without data."
          },
          {
            "name": "total_generation_twh",
            "type": "number",
            "description": "Total electricity generation, TWh, as published by Ember; the sum of the nine published source values may differ slightly because of rounding."
          },
          {
            "name": "demand_twh",
            "type": "number",
            "description": "Electricity demand, TWh, as published by Ember. Country demand is generation plus net imports. EU regional demand includes trade; other aggregate demand values equal generation, with net imports unpublished."
          },
          {
            "name": "net_imports_twh",
            "type": "number",
            "description": "Net electricity imports, TWh (negative for net exporters). Empty where Ember gives no value."
          },
          {
            "name": "coal_twh",
            "type": "number",
            "description": "Generation from coal, TWh. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "gas_twh",
            "type": "number",
            "description": "Generation from gas, TWh. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "other_fossil_twh",
            "type": "number",
            "description": "Generation from other fossil fuels (oil and other fossil), TWh. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "nuclear_twh",
            "type": "number",
            "description": "Generation from nuclear, TWh. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "hydro_twh",
            "type": "number",
            "description": "Generation from hydro, TWh. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "wind_twh",
            "type": "number",
            "description": "Generation from wind, TWh. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "solar_twh",
            "type": "number",
            "description": "Generation from solar, TWh. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "bioenergy_twh",
            "type": "number",
            "description": "Generation from bioenergy, TWh. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "other_renewables_twh",
            "type": "number",
            "description": "Generation from other renewables (geothermal, tidal and wave), TWh. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "coal_share_pct",
            "type": "number",
            "description": "Share of total generation from coal, percent. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "gas_share_pct",
            "type": "number",
            "description": "Share of total generation from gas, percent. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "other_fossil_share_pct",
            "type": "number",
            "description": "Share of total generation from other fossil fuels (oil and other fossil), percent. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "nuclear_share_pct",
            "type": "number",
            "description": "Share of total generation from nuclear, percent. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "hydro_share_pct",
            "type": "number",
            "description": "Share of total generation from hydro, percent. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "wind_share_pct",
            "type": "number",
            "description": "Share of total generation from wind, percent. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "solar_share_pct",
            "type": "number",
            "description": "Share of total generation from solar, percent. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "bioenergy_share_pct",
            "type": "number",
            "description": "Share of total generation from bioenergy, percent. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "other_renewables_share_pct",
            "type": "number",
            "description": "Share of total generation from other renewables (geothermal, tidal and wave), percent. Empty where Ember gives no row for this source in this year."
          },
          {
            "name": "fossil_share_pct",
            "type": "number",
            "description": "Share of generation from fossil fuels (coal, gas, other fossil), percent (Ember aggregate)."
          },
          {
            "name": "renewables_share_pct",
            "type": "number",
            "description": "Share of generation from renewables (hydro, wind, solar, bioenergy, other renewables), percent (Ember aggregate)."
          },
          {
            "name": "wind_and_solar_share_pct",
            "type": "number",
            "description": "Share of generation from wind and solar, percent (Ember aggregate)."
          },
          {
            "name": "clean_share_pct",
            "type": "number",
            "description": "Share of generation from clean sources (renewables plus nuclear), percent (Ember aggregate)."
          },
          {
            "name": "largest_source",
            "type": "string",
            "description": "The source with the most generation in this area and year (calculated for this dataset from the nine sources; on an exact tie the first in the order coal, gas, other_fossil, nuclear, hydro, wind, solar, bioenergy, other_renewables). Empty if total generation is zero.",
            "constraints": {
              "enum": [
                "coal",
                "gas",
                "other_fossil",
                "nuclear",
                "hydro",
                "wind",
                "solar",
                "bioenergy",
                "other_renewables"
              ]
            }
          }
        ],
        "primaryKey": [
          "area",
          "year"
        ]
      }
    },
    {
      "path": "data/areas.csv",
      "name": "areas",
      "title": "Areas: countries and Ember's aggregate regions",
      "mediatype": "text/csv",
      "format": "csv",
      "encoding": "utf-8",
      "schema": {
        "fields": [
          {
            "name": "area",
            "type": "string",
            "description": "Ember's area name (as in the other tables)."
          },
          {
            "name": "iso3_code",
            "type": "string",
            "description": "Country or economy code supplied by Ember, generally ISO 3166-1 alpha-3; XKX for Kosovo. Empty for regions."
          },
          {
            "name": "area_type",
            "type": "string",
            "description": "country (Ember's 'Country or economy') or region (an aggregate).",
            "constraints": {
              "enum": [
                "country",
                "region"
              ]
            }
          },
          {
            "name": "continent",
            "type": "string",
            "description": "Continent (Ember). Empty for regions."
          },
          {
            "name": "ember_region",
            "type": "string",
            "description": "Ember's region for the country (Africa, Asia, Europe, Latin America and Caribbean, Middle East, North America, Oceania). Empty for regions."
          },
          {
            "name": "eu_member",
            "type": "boolean",
            "description": "Whether the country is a member of the EU, as recorded in the archived Ember release; this flag does not vary by historical year. Empty for regions."
          },
          {
            "name": "oecd_member",
            "type": "boolean",
            "description": "Whether the country is a member of the OECD, as recorded in the archived Ember release; this flag does not vary by historical year. Empty for regions."
          },
          {
            "name": "g20_member",
            "type": "boolean",
            "description": "Whether the country is a member of the G20, as recorded in the archived Ember release; this flag does not vary by historical year. Empty for regions."
          },
          {
            "name": "g7_member",
            "type": "boolean",
            "description": "Whether the country is a member of the G7, as recorded in the archived Ember release; this flag does not vary by historical year. Empty for regions."
          },
          {
            "name": "asean_member",
            "type": "boolean",
            "description": "Whether the country is a member of the ASEAN, as recorded in the archived Ember release; this flag does not vary by historical year. Empty for regions."
          },
          {
            "name": "first_year",
            "type": "integer",
            "description": "First year with data for this area."
          },
          {
            "name": "last_year",
            "type": "integer",
            "description": "Latest year with data for this area."
          }
        ],
        "primaryKey": [
          "area"
        ]
      }
    }
  ],
  "views": [
    {
      "name": "world-generation-by-source",
      "title": "World electricity generation by source, TWh, 2000-2025",
      "resources": [
        "summary"
      ],
      "specType": "vega-lite",
      "spec": {
        "width": "container",
        "height": 340,
        "transform": [
          {
            "filter": "datum.area == 'World'"
          },
          {
            "fold": [
              "coal_twh",
              "gas_twh",
              "other_fossil_twh",
              "nuclear_twh",
              "hydro_twh",
              "wind_twh",
              "solar_twh",
              "bioenergy_twh",
              "other_renewables_twh"
            ],
            "as": [
              "measure",
              "twh"
            ]
          },
          {
            "calculate": "replace(replace(datum.measure, '_twh', ''), '_', ' ')",
            "as": "source"
          },
          {
            "calculate": "indexof(['coal_twh', 'gas_twh', 'other_fossil_twh', 'nuclear_twh', 'hydro_twh', 'wind_twh', 'solar_twh', 'bioenergy_twh', 'other_renewables_twh'], datum.measure)",
            "as": "source_order"
          }
        ],
        "mark": {
          "type": "area"
        },
        "encoding": {
          "x": {
            "field": "year",
            "type": "ordinal",
            "axis": {
              "title": null,
              "labelAngle": 0,
              "values": [
                2000,
                2005,
                2010,
                2015,
                2020,
                2025
              ]
            }
          },
          "y": {
            "field": "twh",
            "type": "quantitative",
            "stack": "zero",
            "axis": {
              "title": "Terawatt-hours"
            }
          },
          "color": {
            "field": "source",
            "type": "nominal",
            "title": null,
            "sort": [
              "coal",
              "gas",
              "other fossil",
              "nuclear",
              "hydro",
              "wind",
              "solar",
              "bioenergy",
              "other renewables"
            ],
            "scale": {
              "domain": [
                "coal",
                "gas",
                "other fossil",
                "nuclear",
                "hydro",
                "wind",
                "solar",
                "bioenergy",
                "other renewables"
              ],
              "range": [
                "#4d4d4d",
                "#b07aa1",
                "#9c755f",
                "#8e6bbf",
                "#4e79a7",
                "#59a14f",
                "#edc948",
                "#8cd17d",
                "#f28e2b"
              ]
            }
          },
          "order": {
            "field": "source_order",
            "type": "quantitative"
          },
          "tooltip": [
            {
              "field": "year",
              "type": "ordinal"
            },
            {
              "field": "source",
              "type": "nominal"
            },
            {
              "field": "twh",
              "type": "quantitative",
              "format": ",.0f",
              "title": "TWh"
            }
          ]
        }
      }
    }
  ]
}
