Skip to content
PocketDesk
Your files are processed on your device, never uploaded

CSV to JSON

  • On device
Input
Ln 1, Col 11 line0 BUTF-8

Paste, drop or open a file in Input to see the result here.

Waiting for input
  • ⌘Enter Format
  • ⌘⇧M Minify
  • ⌘⇧C Copy result
  • ⌘F Find in result
  • Esc Exit full screen
  • Use Ctrl instead of ⌘ on Windows and Linux

How to convert CSV to JSON

  1. Paste your CSV into the Your CSV box, or use Open a file to load a .csv or .tsv file.
  2. Leave Delimiter on automatic, or choose comma, semicolon, tab or pipe.
  3. Keep First row is a header on to get an array of objects. Turn it off to get an array of arrays.
  4. Choose the indentation, then select Copy or Download to save data.json.

How the conversion works

Each CSV row becomes one JSON object, with the header names as keys. Blank lines are skipped, and both Windows and Unix line endings work. A value inside double quotes can hold commas, line breaks and quote marks, and "" inside quotes means one quote character.

Values stay as text by default. That protects postcodes, phone numbers and IDs such as 007. If your data is clean, turn on Convert numbers and booleans, and 42 becomes a number, true becomes a boolean and an empty cell becomes null.

Tips

  • European exports often use semicolons because commas are decimal marks. Automatic detection handles this.
  • If two columns share a header name, the second is renamed with a number so no data is lost.
  • An unclosed quote is reported with a line number, which is the most common reason a CSV breaks.
  • Need the reverse? Try JSON to CSV.
  • Check the result with the JSON formatter to change the layout or sort the keys.

What CSV is

CSV is a plain text table where each line is a row and a delimiter separates the columns. It has no data types, which is why everything starts as text. There is no single official dialect, so files from different programs use different delimiters and quoting habits. A tool that detects the delimiter saves a lot of trial and error.

Privacy

Spreadsheets often hold names, emails and financial rows. This tool reads your data only inside your browser. Nothing is uploaded, stored or logged.

Questions

Does it detect the delimiter automatically?

Yes. It tries commas, semicolons, tabs and pipes. You can choose one yourself if the guess is wrong.

Why are my numbers in quotes?

By default every value stays text so nothing like a leading zero is lost. Turn on Convert numbers and booleans to get real numbers.

Can it handle quoted fields with commas and line breaks?

Yes. Fields in double quotes can contain delimiters, line breaks and doubled quotes.

What if a row has too few or too many columns?

It still converts. Short rows leave out the missing keys. Check the source if columns look shifted.

Is my file uploaded?

No. The conversion runs in your browser.

More developer tools