ToolJutsu
All tools
Developer Tools

CSV to JSON

Convert CSV data into structured JSON.

0 chars
Tip: press Ctrl/ + Enter
Processed on your device. We never see your files.

How to use CSV to JSON

What this tool does

This tool converts CSV — comma-separated values — into JSON. You paste CSV text or drop a .csv file, and it returns a clean, pretty-printed JSON document. With headers enabled you get an array of objects, where each column name becomes a key; with headers disabled you get an array of arrays. The parser is a proper RFC 4180 implementation, so quoted fields, embedded commas, and multi-line cells all survive intact. Every step runs in your browser, so the data never leaves your machine.

Why you might need it

CSV is everywhere — it is what spreadsheets export, what analytics dashboards download, and what legacy systems produce. But almost every modern API, config file, and JavaScript program speaks JSON. Converting between the two by hand is deceptively hard: a naive “split on commas” approach breaks the moment a cell contains a comma, a quote, or a line break. This tool handles those cases correctly, so you can move tabular data into a JSON-based workflow without writing a parser yourself.

How to use it

  1. Paste your CSV into the input box, or drop a .csv file onto it.
  2. Pick a delimiter, or leave it on Auto-detect to let the tool guess.
  3. Toggle First row is headers depending on whether row one names the columns.
  4. Optionally enable Trim whitespace and Infer numbers & booleans.
  5. Click Convert to JSON, or press Ctrl/Cmd + Enter, then copy or download the result.

How the parser works

Rather than splitting on the delimiter, the converter scans the CSV one character at a time and tracks whether it is currently inside a quoted field. Inside quotes, commas and newlines are treated as ordinary text, and a pair of double quotes ("") collapses into one literal quote. Outside quotes, the delimiter ends a field and a newline ends a row. Both \r\n and a lone \n are accepted as line endings. This is what lets a cell like "Said: ""compilers"" first" or a value spanning two physical lines round-trip correctly into a single JSON string.

Common pitfalls

Type inference is convenient but occasionally surprising. A value such as 007 or a phone number with a leading zero will be turned into the number 7 if inference is on — turn it off to keep those as strings. Likewise, very large integers can lose precision once parsed as JSON numbers. Another thing to watch: if your header row has a blank cell, that column is given a generated name like column3 so the JSON keys stay valid. Finally, if auto-detection picks the wrong delimiter — common when a comma-separated file has many semicolons in its text — set the delimiter manually.

Tips and advanced use

For tab-separated files (TSV), simply choose Tab as the delimiter; the same parser handles them. If you plan to feed the JSON into code that expects exact string values — postal codes, account numbers, SKUs — leave inference off so nothing is silently coerced. When a CSV has trailing spaces around values that you do not want, the Trim whitespace option cleans every cell. And because the entire conversion is client-side, you can safely process exports containing emails, names, or internal identifiers without any of it being uploaded.

Frequently asked questions

Is my CSV uploaded anywhere?
No. The CSV is parsed by JavaScript running inside your own browser, and nothing is sent to a server. Exported reports and user data stay on your device, which you can confirm in the browser's Network tab.
Does it handle commas and line breaks inside fields?
Yes. The parser follows RFC 4180: any field wrapped in double quotes can contain commas, line breaks, and the delimiter itself. A doubled quote ("") inside a quoted field is read as a single literal quote.
What does the type-inference option do?
With inference on, values that look like numbers become real JSON numbers and the strings true and false become real booleans. With it off, every value stays a string, which is safer when fields like ZIP codes or IDs have leading zeros.
What if the first row is data, not headers?
Turn off the 'First row is headers' toggle. The output becomes an array of arrays, with one inner array per row, instead of an array of objects keyed by column name.
How does delimiter auto-detection work?
Auto mode counts commas, semicolons, and tabs on the first line, ignoring anything inside quotes, and picks whichever appears most often. If you get the wrong split, choose the delimiter explicitly from the dropdown.

Related tools