Skip to content
helpyself

CSV to JSON

Runs in your browser — your text is not sent anywhere to use this tool.

Save this tool

Keep CSV to JSON handy

Bookmark it

Turn a spreadsheet export into clean JSON, and back again.

  1. Paste your CSV, or your JSON if you want to go the other way
  2. Leave the separator on automatic unless the preview looks wrong
  3. Convert, then copy or download the result

Leave type conversion off to keep postcodes and product codes exactly as written.

About this tool

Almost every system will export a CSV and almost every system will accept JSON, so this is the conversion that sits between a spreadsheet and anything that needs to read it. The awkward part is never the commas. It is the quoted field containing a comma, the address with a line break inside it, and the doubled quote that stands for one literal quote — all three appear constantly in real exports, and all three break the obvious approach of splitting on the separator. This reads the file character by character the way the CSV specification describes, so those cases come out intact. It also guesses the separator rather than assuming a comma, which matters in Denmark and most of continental Europe, where exports are semicolon-separated because the comma is already the decimal point. Type conversion is available but off by default, because postcodes and product codes are digit strings whose leading zeros are data, and turning 007 into 7 is a silent corruption you would not notice until much later. Everything runs in your browser, so the file never reaches a server.

Frequently asked questions

Why does my file use semicolons instead of commas?

Because in Danish, German, French and most other European locales the comma is the decimal separator, so spreadsheets use a semicolon to keep numbers readable. Excel picks the separator from your system region. The converter detects it from the first line rather than assuming, so both kinds of file work without you changing anything.

Will it break if a field contains a comma or a line break?

No. Fields wrapped in quotes may contain the separator, line breaks, and quotes themselves written as two quote characters. All three are parsed properly rather than split on blindly, which is the main thing that separates this from a one-line script.

Why did my postcode lose its leading zero?

It will not, unless you switch on type conversion. That option turns digits into numbers and true or false into booleans, which is useful for genuinely numeric data and destructive for codes that merely look numeric. It is off by default for exactly that reason.

What happens if two columns have the same name?

The second one is kept and suffixed, so a file with two name columns produces name and name_2. Overwriting would silently drop a whole column, and a dropped column is much harder to notice than an oddly named one.

Can I convert JSON back into CSV?

Yes. Switch the direction and paste a JSON array. Objects are turned into rows, and the column list is the union of every object's keys, so a record missing a field still lines up rather than shifting the table. Values are quoted only where the format requires it.

Help improve this tool

Found a bug, want a change, or need a tool we don't have?

/csv-to-json

↑↓ to move · Enter to open · Esc to close