Convert CSV data into a clean JSON array of objects, using the first row as keys. Paste your CSV and copy the JSON — all privately in your browser.
SYSTEM ● ONLINE · LOCAL COMPUTE · ZERO UPLOAD
UNIT // CSV.JSONLIVE
0
Rows
0
Columns
—
Status
Quick Answer
How do you convert CSV to JSON?
// Answer
Take the first row of the CSV as the field names (headers), then turn each following row into a JSON object that maps each header to its value. The result is a JSON array of objects. This tool does it instantly and handles quoted fields containing commas.
Why use this tool
Spreadsheets to code
CSV is how spreadsheets and exports travel; JSON is how apps and APIs consume data. Converting between them is a constant need. This tool keeps your data on your device — important when the CSV holds customer or business information.
FAQ
Frequently asked questions
The first row is used as the keys (field names) for each JSON object.
Yes, values wrapped in double quotes can contain commas and are parsed correctly.
No. The conversion runs entirely in your browser.
Yes, use our JSON to CSV tool for the reverse direction.
CSV is harder than it looks, and every value here stays a string
// Answer
The hard part of CSV is not splitting on commas. It is quotes, embedded newlines, and separators that change by locale. This parser handles those. It does not guess types: every value comes out as a JSON string, which is why leading zeros survive.
Many converters guess types; this one deliberately does not. A converter that "helpfully" turns 007 into 7 and 3/4 into a date has destroyed your data while appearing to succeed. This one converts nothing, so you get exactly the characters that were in the cell — and if your code wants numbers, it casts them itself, where you can see it happening.
Reference
The eleven things that break CSV, and which of them this handles
Written by reading the parser, not by guessing.
The problem
Handled here?
Detail
Comma inside a quoted field
Yes
"Smith, Jane" stays one field.
A quote inside a quoted field
Yes
Doubled quotes are the escape: "6"" pipe" becomes 6" pipe.
A line break inside a quoted field
Yes
A multi-line address in one cell does not split the row.
Windows, Unix or old Mac line endings
Yes
CRLF, LF and bare CR are all treated as row ends.
A byte order mark at the start
Yes
The invisible U+FEFF that Excel writes is stripped, so your first key is name and not name with a hidden character welded to the front of it.
Leading zeros
Yes
Preserved, because nothing is converted to a number.
Blank lines
Yes
Dropped rather than becoming empty objects.
Semicolon separator
Yes
Detected from the header line, along with comma, tab and pipe. The tool names the separator it chose.
Tab or pipe separator
Yes
Detected the same way. If the header line holds no separator at all, you get one column and a note saying so.
Spaces inside a field
Trimmed
Leading and trailing whitespace is removed from every value and header, quoted or not. " x " becomes x.
Repeated header names
Last wins
Two columns called email collapse into one key, holding the rightmost value.
Two more worth knowing. If a row has fewer cells than there are headers, the missing keys appear with an empty string rather than being left out — so every object in the array has the same shape. If a row has more cells than headers, the extras are dropped, because there is no name to file them under.
Worked example
A deliberately awkward CSV
Everything below is invented. It packs four of the traps into three rows: a comma inside a quoted name, a doubled quote, a line break inside a field, and a postcode that begins with a zero.
Input line
What it tests
ref,customer,note,postcode
The header row becomes the keys.
A-1,"Okonkwo, Ada",plain,01810
Quoted comma; leading zero kept.
A-2,Vance,"wants a 6"" bracket",TW9
A doubled quote becomes one literal quote.
A-3,Lindqvist,"two lines",EC1A
A line break inside quotes stays inside the field.
The result is three objects. ref is "A-1", customer is "Okonkwo, Ada" with the comma intact, note on the second row is wants a 6" bracket, and postcode on the first row is the string "01810" — not the number 1810. Paste the result into the JSON formatter if you want to check the nesting, or run it back through JSON to CSV to confirm nothing was lost on the way in.
The mistake
The file that opens as a single column
This tool detects comma, semicolon, tab and pipe, so a semicolon file converts as it is. The background still matters when a file moves between other programs: Excel writes .csv files using the list separator from the Windows regional settings, and in places where the comma is the decimal mark that separator is often a semicolon. The file is still called .csv. It is not comma-separated.
Three ways out, best first:
Re-export properly. In Google Sheets, Download → Comma-separated values. In Excel the separator follows the Windows list separator even for the CSV formats, so open the saved file in a text editor and check before sending it on.
Change the separator at the source. The separator Excel writes follows the list separator in the operating system's regional settings, so changing that setting and re-exporting produces a genuinely comma-separated file. Worth doing once if you export regularly.
Swap the characters by hand with find and replace — but only after checking that no field contains a comma of its own. If any value does, replacing every ; with , will corrupt the row count in a way that is very hard to spot afterwards. It is a last resort, not a shortcut.
And the leading zeros were probably already gone
If your postcodes or product codes arrive here as 1810 instead of 01810, this tool did not eat the zero — it cannot, because it never parses numbers. Excel ate it when the file was opened, long before you copied anything. Reopening a CSV in a spreadsheet and saving it again is a lossy operation. Take the export straight from the source system to here, and skip the round trip through a spreadsheet entirely.
Limits
What this is not for
It is a flat converter: one CSV row becomes one flat JSON object, always. Nesting cannot be expressed — a column called address.city produces a key literally named address.city. There is no type inference, no date parsing, no schema and no validation, so a malformed row raises no warning; it just produces an object with empty strings in it.
Nor is it built for very large exports. The whole text sits in the textarea and the parser walks it character by character on every keystroke, so tens of thousands of rows make typing feel sticky and a file of hundreds of megabytes belongs in a script. To see how big the thing you are holding actually is, the character counter beats guessing.
Privacy
Why it matters that this one runs locally
CSV is the format business data travels in, which means the file in your clipboard right now is unusually likely to be the sensitive kind: a customer export with names, email addresses and order totals; a payroll extract; a patient list; a leavers' report. That is the whole point of the format.
Pasting that into a converter hosted by someone you cannot name is a transfer of personal data to a third party you have no agreement with, no record of and no way to audit — under the GDPR, a processor relationship created by accident. It is the sort of thing that surfaces in a security questionnaire a year later, when nobody remembers which website they used.
This page has nothing in the path to leak to. The parser is about twenty lines of JavaScript with no fetch, no XMLHttpRequest and no analytics call in it. The check takes ten seconds: load the page, disconnect from the network, paste your CSV. The JSON still appears. Everything on the developer tools page is built the same way, so the output can go straight into JSON to YAML without touching a server.