Fiatmap

CSV vs JSON for Economic Data: Which Format to Download

2026-11-15

CSV and JSON title card with sketched data motifs

Use CSV when your economic data is a flat table you will open in a spreadsheet, a statistics package or a quick script. Use JSON when the data has nested parts, such as a country with several indicators, each with its own metadata, or when an app or API will consume it. Fiatmap offers its official-statistics datasets as downloadable CSV and JSON, so you can take the shape that fits the job and switch later without hunting for a new source.

Fiatmap
Compare Economic Data Across Countries
Explore official statistics, mortgage rates, inflation and other economic data across 128 countries in Fiatmap’s financial atlas.
Visit

TL;DR

Table of Contents

The short answer: pick by the shape of your data

The useful question is not which format is better. It is what your data looks like and where it is going next.

Economic data usually arrives in one of two shapes. The first is a table: one row per country and year, one column per indicator, or the long version with one observation per row. The second is a tree: a country object holding a list of indicators, each holding a list of yearly values and a block describing the source, the unit and the frequency.

CSV is natural for the first shape. JSON is natural for the second. You can flatten a tree into a table or fold a table into a tree, but each conversion has a cost, which the next sections cover.

CSV table compared with nested JSON data structure

What the two formats actually are

CSV stands for comma-separated values. It is plain text, one record per line, with fields divided by a delimiter. Its common specification is RFC 4180, with the media type text/csv. The NCBI format reference notes that CSV stores only strings, which means a spreadsheet or library has to guess whether 4.10 is a number and whether 2025-03 is a date.

JSON stands for JavaScript Object Notation. It is also plain text, but it is structured: objects, arrays, strings, numbers, booleans and null, specified in RFC 8259 with the media type application/json. The same NCBI reference calls it the lingua franca of API services.

In short, CSV is a table without types. JSON is a tree with basic types.

Side by side

The comparison below draws on the NCBI reference for the format traits and on the sources linked in the later sections.

Trait CSV JSON
Shape Flat rows and columns Nested objects and arrays
Data types Strings only, types inferred by the reader Numbers, strings, booleans, null
Size Compact Verbose, since keys repeat
Parsing Fast, though real-world files often break the standard Depends on the library, from slow to very fast
Schema Column names only Optional JSON Schema
Embedded metadata None None
Best fit Spreadsheets, statistics tools, quick comparisons APIs, web apps, hierarchical records

Two details matter for economic work. First, CSV’s low compliance in the wild is a practical warning: files from different publishers may use different delimiters, quoting or decimal marks. Second, the absence of embedded metadata in both formats is the reason a bare download can mislead you, which we come back to below.

Time series, missing values and data types

Time series

A time series is the set of observations for one thing over time, such as an annual inflation rate for one country. The Australian Bureau of Statistics explains that observations can be grouped by time, by cross-section (every state in one month) or returned as a flat list. That choice maps directly onto the formats.

A flat list, one observation per row, is the classic CSV layout. The long format is easy to filter and pivot. A grouped series, with a country holding an array of dated values, is the classic JSON layout. It is easier to hand to a chart.

The OECD Data API documentation describes an observation as identified by dimension values such as country and year. Its flattened SDMX-CSV format carries one observation per row, while the structural description comes back in the structure part of SDMX-JSON responses.

Missing values

Missing data is where economic files bite. A blank cell, a zero, a dash and n/a all appear in real downloads, and they mean different things. A zero is a measurement. A blank is an absence.

CSV has no native way to say “missing”, so every publisher invents a convention. The SDMX-CSV field guide codes intentionally missing numeric observations as NaN and other missing values as #N/A. JSON has a real null, and the ABS guide says a reported missing observation has the data type null. When you load either format, confirm that missing values do not silently become zeros.

Data types

Because CSV is all strings, your tool decides the types. A well-documented dataset helps here. The World Bank Metadata Editor documentation shows what a careful indicator file records for each column: a header name, a label, a data type (string, integer, float, date or boolean), a role such as time period, geography or observation value, and the time period format, for example YYYY for annual data.

If you convert between the formats, the W3C specification for generating JSON from tabular data defines the mapping. Decimals, integers and floats become JSON numbers. Dates, years and durations become JSON strings. So a year such as 2025 can arrive as text, and you should not be surprised when a sort puts it in the wrong place.

When CSV is the better download

Choose CSV in these situations:

The Eurostat user guide lists its formats and spells out the difference between two flat ones: TSV holds one time series per line, while CSV holds one observation per line. It also limits the spreadsheet format to datasets of up to 750,000 cells, which is a reminder that a plain text file scales further than a workbook.

The European Data Portal supplier guidelines say a CSV should hold a single table of values, with descriptions, comments and update dates kept outside the file. The same guidelines suggest a format such as JSON or XML when that information changes with each distribution. That is a clean rule: if the file needs to carry its own context, CSV is the wrong container.

The IHSN NADA documentation gives a good template for statistical CSVs. Each row holds the series identifier, the dimensions such as country name, country code and year, and one value, with a data dictionary uploaded alongside. It also recommends numeric codes for categories, such as 0, 1 and 2 for total, male and female, to reduce file size and speed up filtering.

When JSON is the better download

Choose JSON in these situations:

The ICAEW makes the structural point well: CSV is limited to two dimensions, so data whose column count depends on the number of transactions produces an unpredictable layout that makes recurring processing unreliable. JSON’s nested key-value hierarchy copes with that kind of data.

The World Bank prefers JSON for structured metadata because it is lightweight, human-readable, hierarchical, supported across programming languages and easy to load into SQL and NoSQL databases. Eurostat describes its JSON-stat format as suited to data visualization, mobile apps and open data projects.

If your goal is to wire economic data into a financial system, the format question sits inside a wider integration question. A practical guide to ISO 20022 migration shows how message formats shape the work for payment teams, and the same thinking applies when you choose how an indicator feed is structured.

What the official agencies do

The agencies that publish economic statistics rarely pick one format. Eurostat offers spreadsheet, TSV, CSV, SDMX-CSV, SDMX-ML and JSON-stat downloads. The ILOSTAT SDMX guide lists SDMX-ML, SDMX-JSON and SDMX-CSV, with SDMX-ML Generic 2.1 as the default when no format is requested. The OECD’s API serves both SDMX-CSV and SDMX-JSON.

SDMX is a shared standard for statistical data and metadata. The pattern across all three agencies is the same: a flat form for people and tools that want a table, and a structured form for machines that want the observations together with their description. That is the split to copy in your own work.

A worked example: the same mortgage data in both shapes

Say you want mortgage rates for three countries over two years. Here is a layout sketch, with placeholder values to show the shape, not real figures.

As CSV in long form, one observation per row:

country,year,mortgage_rate_pct
Country A,2024,0.00
Country A,2025,0.00
Country B,2024,0.00
Country B,2025,0.00

As JSON, grouped by country:

[
  {
    "country": "Country A",
    "indicator": "mortgage_rate_pct",
    "unit": "percent",
    "values": [
      {"year": 2024, "value": null},
      {"year": 2025, "value": 0.00}
    ]
  }
]

The CSV is shorter and pastes straight into a spreadsheet, where a pivot table gives you a countries-by-years grid in seconds. The JSON is longer, but it holds the unit inside the record and states a missing value as null instead of an empty cell. If you are building a chart or an app, the JSON saves you a reshaping step. If you are scanning for the cheapest mortgage market, the CSV is quicker.

A mortgage rate itself is easy to misread across borders, so it helps to know the definition first: our mortgage rate glossary page explains it, and the ranking of mortgage rates by country shows the figures side by side.

A worked example: the same mortgage data in both shapes

Checks before you compare countries

The file format is the easy half. The harder half is making sure numbers from different countries mean the same thing. Whatever you download, check these:

  1. Unit. Percent, percentage points, index points, local currency or US dollars. A column named value says nothing.
  2. Period and frequency. Annual, quarterly or monthly, and whether it is an average over the period or a reading at the end. The World Bank’s metadata fields show why this is recorded explicitly: time period format and periodicity are part of the structure.
  3. Definition. Two countries can report a mortgage rate or an inflation rate from different baskets, loan types or sampling methods. Read the definition from the statistical agency, not the column header.
  4. Source and release date. Statistics are revised. Record where and when you downloaded the file.
  5. Missing values. Confirm which convention the file uses, and that your tool does not turn blanks into zeros.
  6. Types after loading. Years should be integers or dates, rates should be numbers, and country codes should stay text.

Our guide to economic indicators by country walks through these definitions for the main indicators, and the post on export dependency by country shows a full download and reproduce workflow from a CSV.

When you move on to analysis, a guide on analyzing trading data is useful for the parsing and data-type habits that carry over from market data to macro series.

Our perspective

We built Fiatmap around one rule: every number comes from official statistics. A data format is only a container, so the thing that decides whether your comparison holds is what sits inside it.

That is why we think the CSV vs JSON debate is often the wrong debate. Analysts, expats, students and homebuyers rarely lose time on a parser. They lose it on a unit that changed, a period that did not match or a country that defines an indicator differently. A reliable source, with the same indicators laid out the same way across 128 countries, removes most of that.

Still, the container matters at the margin, and we want readers to have both. A flat file is the right tool for a spreadsheet and a quick country-to-country comparison. A structured file is the right tool when the data feeds something you build. So we offer our datasets in CSV and JSON, along with embeddable maps and tables, and let you decide.

Our advice is simple: start from the question, pick the shape that answers it, and keep the source and definition next to the data.

Torstein

Get the data in the format you need

Fiatmap is a free atlas of mortgage rates, inflation rates and more than 35 macroeconomic metrics across 128 countries, drawn from official statistics. You can compare countries with interactive visualizations, download datasets as CSV or JSON, and embed maps and tables on your own site.

Fiatmap

If you are starting with housing finance, open the mortgage rates by country ranking and download the table in the format that suits your workflow. For prices, the inflation rate ranking works the same way, and our mortgage story shows how far the same loan can differ between countries. You can start from the Fiatmap home page at any time.

FAQ

Is CSV or JSON better for economic data?

Neither wins in every case. CSV is better for flat tables you will open in a spreadsheet or statistics tool, such as one indicator across many countries. JSON is better for nested records, APIs and apps, because it holds types, nulls and metadata in one structure.

Is JSON bigger than CSV?

Usually yes. JSON repeats key names on every record, which the NCBI reference describes as verbose, while CSV is compact. For a large flat table the size gap can be noticeable, though the practical difference depends on your tools and compression.

Can CSV store metadata such as units and definitions?

Not reliably. Neither format has embedded metadata, and publishing guidance advises keeping descriptions and update dates outside a CSV. Keep a data dictionary or source note with the file, or use a JSON record when the unit and definition must travel with the values.

How should I treat missing values in each format?

Check the publisher’s convention before you analyze. SDMX-CSV uses NaN for missing numbers and #N/A for other types, while JSON uses null. After loading, confirm that blanks did not become zeros, since a zero is a measurement and a blank is not.

Can I convert between CSV and JSON?

Yes. The W3C defines how tabular data maps to JSON, with numbers becoming JSON numbers and dates and years becoming strings. After converting, recheck the types, because a year can become text and a missing value can change form.

Sources

The figures on this site are collected from official statistics and each carries its own source and date — see /sources and the dataset. Where this article states a number, the country and ranking pages are what it should agree with.