Skip to main content
v2026.11,986 entries · CC-BY 4.0

Direct comparison

CSV vs JSON: Standards and When to Use Each

CSV vs JSON compared on what RFC 4180 and RFC 8259 specify: standards status, data types, encoding, quoting and when to use each for research data.

Written and maintained by CASRAI Editorial Board

Last updated

In summary

The two formats differ first in standing. CSV is described by RFC 4180, an Informational RFC from 2005 that itself says no formal specification exists and that defines structure and quoting but no data types. JSON is defined by RFC 8259, an Internet Standards Track document with a value grammar (strings, numbers, booleans, null, objects, arrays) and mandatory UTF-8 for open exchange. Pick CSV when your data is one table whose rows share the same fields and you will describe types and units in a separate file. Pick JSON when values must nest or carry the types the JSON grammar defines.

How do CSV and JSON compare side by side?

The table below compares CSV and JSON across 10 dimensions, from standards status to when to pick each.

Side-by-side comparison

DimensionCSVJSON
Standards statusRFC 4180 (Y. Shafranovich, October 2005) is category Informational and "does not specify an Internet standard of any kind."RFC 8259 (December 2017) is on the Internet Standards Track.
Formal specificationRFC 4180 states that "there is no formal specification in existence, which allows for a wide variety of interpretations of CSV files."RFC 8259 defines a grammar: value = false / null / true / object / array / number / string.
StructureEach record is on a separate line, delimited by a line break (CRLF). There may be an optional header line first. Each line should contain the same number of fields throughout the file.A value can be an object or an array, and objects and arrays hold further values, so data can nest.
Data typesRFC 4180 defines structure and quoting only, with no data types. Spaces are part of a field and are not trimmed.Strings, numbers, booleans (true/false) and null, plus objects and arrays.
Quoting and edge casesFields containing line breaks, double quotes or commas should be enclosed in double quotes. A double quote inside a quoted field is escaped by another double quote.Leading zeros are not allowed in numbers, and Infinity and NaN are not permitted (RFC 8259 section 6).
Duplicate or inconsistent entriesLines are expected to carry the same number of fields ("should"), so uneven rows depart from the RFC description.Names within an object SHOULD be unique. If they are not, "the behavior of software that receives such an object is unpredictable."
EncodingThe text/csv registration has an optional charset parameter.JSON text exchanged between systems that are not part of a closed ecosystem MUST be encoded using UTF-8 (RFC 8259 section 8.1).
Media typetext/csv, with optional parameters charset and header (present or absent). The W3C tabular data model also gives text/csv as the content type for a CSV file.application/json.
MetadataThe W3C tabular data model defines no format for embedding metadata in a CSV file beyond the header row's column titles; metadata is kept in a separate file. Units of measure are not a built-in part of that model.Objects pair each value with a name (RFC 8259 section 4), so labels travel with the values.
When to pick eachOne table whose rows share the same fields, where types and units are documented separately (for example in a W3C-style metadata file).Values that nest, or data that must carry the types the JSON grammar defines, exchanged as UTF-8.

Sources

  • RFC 4180 and the W3C Model for Tabular Data and Metadata on the Web (Recommendation, 17 December 2015), read 2026-10-29
  • RFC 8259, read 2026-10-29

Common questions

Common questions about CSV vs JSON

Is CSV a standard?

+

Not an Internet standard. RFC 4180 is an Informational RFC that "does not specify an Internet standard of any kind," and it notes that no formal specification of CSV exists. It does register the text/csv media type. The W3C tabular data model builds on RFC 4180 for tabular data on the web.

Does JSON have data types?

+

Yes. The RFC 8259 grammar defines a value as false, null, true, an object, an array, a number or a string. CSV, by contrast, is defined by RFC 4180 for structure and quoting only, with no data types.

Can CSV carry metadata such as datatypes or units?

+

Not inside the file. The W3C tabular data model defines no format for embedding metadata in a CSV file beyond column titles in the header row. Metadata is supplied separately, and units of measure are not a built-in part of the model.

What encoding must JSON use?

+

RFC 8259 section 8.1 says JSON text exchanged between systems that are not part of a closed ecosystem MUST be encoded using UTF-8. The media type is application/json.

Ask CASRAI · full access

Ask about CSV vs JSON: Standards and When to Use Each

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →