Skip to main content
OS Authority

Convert CSV to JSON in your browser

Paste CSV, choose its delimiter and decide whether the first row contains headers. Convert quoted fields and multiline values into JSON while keeping every cell value as text.

Processing runs in a worker in your current browser tab. Your text and results are not uploaded or included in analytics. This tool does not save them between visits.

How it works

  1. Paste CSV text and choose comma, semicolon, tab or pipe to match its delimiter.
  2. Enable First row contains headers for an array of objects, or disable it for an array of row arrays. Select Convert to JSON.
  3. Review the first 50 data rows, then copy or download the complete JSON output. Fix any reported quoting, header or row-width error before converting again.

Headers become JSON keys

When headers are enabled, the first nonblank record supplies the object keys and is not included as a data row. Headers must be nonempty after checking surrounding whitespace, and must be unique with case distinguished. Their original spaces are preserved rather than trimmed. With headers disabled, every record becomes an array of strings. Every row must have the same number of cells; a trailing delimiter represents an empty final cell.

Quotes and multiline cells

A quoted field can contain the selected delimiter, line breaks and doubled double-quotes. For example, a header row name,postcode followed by a record with the quoted name Smith, Ada and postcode 00123 produces one object whose name includes the comma and whose postcode is the string 00123. A quote must start at the beginning of a field; whitespace or other characters after a closing quote are rejected. Comma follows the common RFC 4180 form; other delimiters are explicit extensions, not support for every CSV dialect.

Why values remain strings

A value such as 00123 keeps its leading zeros; dates, large identifiers, empty cells and formula-looking text remain strings too. The converter does not infer numbers, dates or booleans, and does not execute spreadsheet formulas. Header names such as __proto__ and constructor are serialized as ordinary data properties. JSON still needs appropriate handling in whatever program consumes it.

Blank lines and bounded previews

A physically empty line outside a quoted field is ignored. A whitespace-only line or a quoted empty field is a real record and must have the expected width. An initial UTF-8 byte-order mark is removed; embedded marks and quoted line endings are retained. The preview includes at most 50 data records; Copy and Download JSON include all records within the input, aggregate cell and UTF-8 output-byte limits. Both header cells and data cells count toward the displayed cell budget.

Frequently asked questions

Can a field contain commas or line breaks?

Yes. Enclose it in double quotes when it contains the selected delimiter or a line break. Represent a double quote inside that field as two consecutive double quotes.

What happens if headers repeat or are empty?

Conversion stops with an error. Correct the header row, or turn off headers to keep every row as an array. Headers that differ only in capitalization remain distinct.

Why are numbers surrounded by quotes in the output?

All CSV cells are kept as strings, preserving leading zeros and large identifiers. Convert types in your application only after applying the rules appropriate to your data.

Can this convert JSON back to CSV?

No. This page converts CSV to JSON only. Use JSON Formatter to format or minify an existing JSON document.

Sources

Last reviewed: October 18, 2026

Related tools