Skip to content

CSV to JSON Converter

Convert CSV to JSON and back, with delimiter detection and Excel-safe export.

Runs entirely in your browser

Conversion happens in your browser. Your data — names, phone numbers, whatever the file holds — is never uploaded.

CSV looks simple until the third file of the day proves otherwise. One export wraps fields in quotes, the next hides commas inside addresses, a third arrives from Excel with a byte-order mark glued to the first header and semicolons where you expected commas. A converter that only handles the tidy case mangles precisely the files you actually receive.

More about CSV to JSON Converter

This tool parses CSV the way the RFC says and the way spreadsheets actually write it: quoted fields with embedded commas and newlines, doubled quotes as escapes, any of the three line-ending styles, and a BOM stripped rather than smeared into the first column name. The delimiter is detected from the data — comma, semicolon, tab or pipe — and you can override the guess with one click.

Type detection is deliberately conservative. Numbers and booleans become real JSON values, but a Vietnamese phone number keeps its leading zero, an ID longer than JavaScript can hold exactly stays a string, and nothing that merely looks like a date gets rewritten. A converter that turns 0912345678 into 912345678 has corrupted your data, however clean its output looks.

Going the other way, JSON arrays become CSV that Excel opens correctly: CRLF line endings, an optional BOM so Vietnamese text survives the round trip, and — on by default — a guard that escapes cells starting with =, +, - or @ so a malicious value cannot execute as a formula on someone else's machine.

Ragged rows are padded and reported per row instead of silently truncated, and duplicate headers get numbered suffixes instead of overwriting each other.

  • Full RFC 4180 parsing: quoted delimiters, embedded newlines, doubled quotes
  • Delimiter auto-detection with a manual override
  • Conservative type inference that never breaks phone numbers or big IDs
  • Header row handling with numbered suffixes for duplicate names
  • Ragged rows padded with null and reported per row
  • Excel-safe export: CRLF, optional BOM, formula escaping on by default
  • Large files converted off the main thread

How to use it

  1. 1Paste CSV or JSON into the input, or open a file.
  2. 2Check the detected delimiter and override it if the guess is wrong.
  3. 3Toggle the header row and type detection options to match your data.
  4. 4Press CSV → JSON or JSON → CSV.
  5. 5Review any row warnings, then copy or download the result.

Questions

Why did my phone numbers stay strings instead of becoming numbers?

A value with a leading zero loses that zero the moment it becomes a JSON number, so phone numbers and similar codes deliberately stay strings. The same protection applies to integers too large for JavaScript to hold exactly.

What does the BOM option do?

It prefixes the CSV with an invisible marker that tells Excel the file is UTF-8, without which Vietnamese characters often open as garbled text. Turn it on when the file is headed for Excel; most other tools ignore it either way.

What is formula escaping and why is it on by default?

A CSV cell starting with =, +, - or @ can execute as a formula when opened in Excel or Google Sheets, so the escape prefixes such cells with an apostrophe and they open as harmless text. Leave it on unless you specifically need live formulas.

How are rows with the wrong number of fields handled?

Short rows are padded with null so every object has every key, and long rows keep their extra cells under generated column names. Each affected row is listed in a warning, so nothing is dropped silently.

Why did the delimiter come out as semicolon?

Exports from European and Vietnamese Excel setups often use semicolons because the comma is the decimal separator there, and the detector picks whichever candidate is most consistent across the first lines. If the guess is wrong, pick the right one from the dropdown.

More Developer Tools
Esc

16 results