Data

Government spending as share of GDP

See all data and research on:

About this data

Government spending as share of GDP
The sum of all the money spent by the government on goods and services, as a percentage of GDP. It includes interest paid on government debt.
Source
International Monetary Fund (2025)with minor processing by Our World in Data
Last updated
April 2, 2025
Next expected update
April 2026
Date range
1800–2023
Unit
% of GDP

Sources and processing

International Monetary Fund – Public Finances in Modern History

The Public Finances in Modern History Database documents two-hundred years of the history of budget deficits and government debts. The current version covers 151 countries over the period 1800–2022, subject to data availability. These data were assembled from a wide array of historical sources, which are documented in the Appendix of Data Sources. The initial database, which covered 55 countries, was analyzed in “A Modern History of Fiscal Prudence and Profligacy”, Journal of Monetary Economics, 2015, Vol. 76, pp. 55–70, by Paolo Mauro, Rafael Romeu, Ariel Binder, and Asad Zaman.

A distinguishing feature of the database is the presence of primary balance data, which is the difference between a government's revenues and its non-interest expenditures, alongside the corresponding government debt data. The primary balance is the most accurate reflection of government fiscal policy decisions. We invite you to explore these data through the interactive graphs below and take in a glimpse of the history of deficits and debts around the world.

Retrieved on
April 2, 2025
Citation
This is the citation of the original data obtained from the source, prior to any processing or adaptation by Our World in Data. To cite data downloaded from this page, please use the suggested citation given in Reuse This Work below.
International Monetary Fund (2025). Public Finances in Modern History

The Public Finances in Modern History Database documents two-hundred years of the history of budget deficits and government debts. The current version covers 151 countries over the period 1800–2022, subject to data availability. These data were assembled from a wide array of historical sources, which are documented in the Appendix of Data Sources. The initial database, which covered 55 countries, was analyzed in “A Modern History of Fiscal Prudence and Profligacy”, Journal of Monetary Economics, 2015, Vol. 76, pp. 55–70, by Paolo Mauro, Rafael Romeu, Ariel Binder, and Asad Zaman.

A distinguishing feature of the database is the presence of primary balance data, which is the difference between a government's revenues and its non-interest expenditures, alongside the corresponding government debt data. The primary balance is the most accurate reflection of government fiscal policy decisions. We invite you to explore these data through the interactive graphs below and take in a glimpse of the history of deficits and debts around the world.

Retrieved on
April 2, 2025
Citation
This is the citation of the original data obtained from the source, prior to any processing or adaptation by Our World in Data. To cite data downloaded from this page, please use the suggested citation given in Reuse This Work below.
International Monetary Fund (2025). Public Finances in Modern History

All data and visualizations on Our World in Data rely on data sourced from one or several original data providers. Preparing this original data involves several processing steps. Depending on the data, this can include standardizing country names and world region definitions, converting units, calculating derived indicators such as per capita measures, as well as adding or adapting metadata such as the name or the description given to an indicator.

At the link below you can find a detailed description of the structure of our data pipeline, including links to all the code used to prepare data across Our World in Data.

Read about our data pipeline

How to cite this page

To cite this page overall, including any descriptions, FAQs or explanations of the data authored by Our World in Data, please use the following citation:

“Data Page: Government spending as share of GDP”, part of the following publication: Esteban Ortiz-Ospina, Bertha Rohenkohl, Pablo Arriagada, and Max Roser (2016) - “Government Spending”. Data adapted from International Monetary Fund. Retrieved from https://archive.ourworldindata.org/20260304-094028/grapher/historical-gov-spending-gdp.html [online resource] (archived on March 4, 2026).

How to cite this data

In-line citationIf you have limited space (e.g. in data visualizations), you can use this abbreviated in-line citation:

International Monetary Fund (2025) – with minor processing by Our World in Data

Full citation

International Monetary Fund (2025) – with minor processing by Our World in Data. “Government spending as share of GDP” [dataset]. International Monetary Fund, “Public Finances in Modern History” [original data]. Retrieved March 31, 2026 from https://archive.ourworldindata.org/20260304-094028/grapher/historical-gov-spending-gdp.html (archived on March 4, 2026).

Quick download

Download the data shown in this chart as a ZIP file containing a CSV file, metadata in JSON format, and a README. The CSV file can be opened in Excel, Google Sheets, and other data analysis tools.

Data API

Use these URLs to programmatically access this chart's data and configure your requests with the options below. Our documentation provides more information on how to use the API, and you can find a few code examples below.

Data URL (CSV format)
https://ourworldindata.org/grapher/historical-gov-spending-gdp.csv?v=1&csvType=full&useColumnShortNames=false
Metadata URL (JSON format)
https://ourworldindata.org/grapher/historical-gov-spending-gdp.metadata.json?v=1&csvType=full&useColumnShortNames=false

Code examples

Examples of how to load this data into different data analysis tools.

Excel / Google Sheets
=IMPORTDATA("https://ourworldindata.org/grapher/historical-gov-spending-gdp.csv?v=1&csvType=full&useColumnShortNames=false")
Python with Pandas
import pandas as pd
import requests

# Fetch the data.
df = pd.read_csv("https://ourworldindata.org/grapher/historical-gov-spending-gdp.csv?v=1&csvType=full&useColumnShortNames=false", storage_options = {'User-Agent': 'Our World In Data data fetch/1.0'})

# Fetch the metadata
metadata = requests.get("https://ourworldindata.org/grapher/historical-gov-spending-gdp.metadata.json?v=1&csvType=full&useColumnShortNames=false").json()
R
library(jsonlite)

# Fetch the data
df <- read.csv("https://ourworldindata.org/grapher/historical-gov-spending-gdp.csv?v=1&csvType=full&useColumnShortNames=false")

# Fetch the metadata
metadata <- fromJSON("https://ourworldindata.org/grapher/historical-gov-spending-gdp.metadata.json?v=1&csvType=full&useColumnShortNames=false")
Stata
import delimited "https://ourworldindata.org/grapher/historical-gov-spending-gdp.csv?v=1&csvType=full&useColumnShortNames=false", encoding("utf-8") clear