Get the Government Tax Revenue to GDP Ratio for a variety of countries over time from the Global Macro Database (GMDB). The Government Tax Revenue to GDP Ratio is the ratio of the total amount of money that a government collects from taxes to the Gross Domestic Product (GDP).

Data comes from the Global Macro Database (GMDB), further information about the variable can be found within https://www.globalmacrodata.com/documentation.html

The ratio is expressed as a decimal fraction (0.1022 for 10.22% of GDP).

The ratio is the Global Macro Database’s own figure, published in percent and divided by 100 here.

The formula is as follows:

\[\text{Government Tax Revenue to GDP Ratio} = \text{Government Tax Revenue} / \text{Nominal GDP},\;\; \text{using the level of government selected with level ("consolidated" by default)}\]

Also known as: tax burden, tax to GDP ratio.

Tax Revenue to GDP in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_government_tax_revenue_to_gdp_ratio as shown below.

from financetoolkit import Economics

economics = Economics(start_date='2015-01-01', end_date="2025-12-31")

economics.get_government_tax_revenue_to_gdp_ratio(
    countries=['United States', 'Canada', 'Mexico'])

Or, after setting up the Finance Toolkit MCP, ask:

How did tax revenue as a share of GDP compare in the United States, Canada and Mexico from 2015 to 2025?

Which returns:

  United States Canada Mexico
2015 0.1994 0.2815 0.1323
2016 0.1958 0.2855 0.1401
2017 0.2031 0.2863 0.1358
2018 0.1874 0.2903 0.136
2019 0.1887 0.2857 0.1369
2020 0.1928 0.2976 0.1484
2021 0.2073 0.3021 0.1443
2022 0.2203 0.2938 0.1449
2023 0.1932 0.2958 0.1538
2024 0.1942 0.2959 nan
2025 0.202 0.2925 nan

Parameters

get_government_tax_revenue_to_gdp_ratio accepts the following parameters.

ParameterTypeDescriptionExample
countrieslist[str] | str | NoneThe countries to include in the data. Defaults to None.["United States", "Germany"]
levelstrThe government the figures cover: “consolidated” (the Global Macro Database’s combination of general and central government figures, with the longest history), “general” (general government: central, state and local government and social security) or “central” (central government only). Defaults to “consolidated”."general"
rollingintThe rolling window size to use for smoothing the data (simple moving average). Defaults to None.4
trailingintThe trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None.4
growthboolWhether to return the growth data or the actual data. Defaults to False.True
lagintThe number of periods to lag the growth data. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
gmdb_forecastsboolWhether to include the years the Global Macro Database projects, from the IMF’s World Economic Outlook, up to five years ahead. Only applies to data from the Global Macro Database. Defaults to False, which ends a series with its last observation.True
Share