CSV to JSON
Turn table data into a JSON array; the delimiter is detected for you
Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.
Did this tool do the job?
Thanks, your feedback came through.
How it works
The first row is treated as the header and supplies the keys of the JSON objects. Left on automatic, the delimiter is now worked out from several rows instead of the first one alone: comma, semicolon, tab and pipe are weighed against each other and the candidate that produces the same number of columns on every row wins, so a header cell that happens to contain a pipe no longer splits the file the wrong way. All three line endings are read: the CR+LF of Windows, the LF of macOS and Linux, and the lone CR that much older programs wrote. Quoted fields are read by the RFC 4180 rules, so a comma or a line break inside quotes counts as data rather than as a separator. With number conversion on, a cell becomes a JSON number only when it has a single reading (34, -3, 12.5); a value that could be read two ways is kept as text, and so are codes with a leading zero and digit strings longer than 15 characters.
This tool is also known as csv to json, convert csv to json, csv to json array, parse csv online, spreadsheet to json.
What is CSV?
CSV (Comma-Separated Values) is the oldest and most widely supported way to keep table data as plain text: one line per record, cells split by a delimiter. It is what a spreadsheet gives you when you export, and what banks and e-commerce dashboards hand over when you download a report. Despite the name the delimiter is not always a comma — locales that use the comma as a decimal mark export with semicolons, which is why any serious parser has to look at the file rather than trust the extension.
What is JSON?
JSON (JavaScript Object Notation) writes data as key-value pairs and lists, and it is the common language of web services: most APIs expect JSON in and return JSON out. Two properties make it worth converting to. It carries type — a number is stored as a number, not as text that happens to look numeric — and it nests, so a record can hold a list of other records. Nearly every programming language reads it in a single call, with no schema to declare first.
What is the difference between CSV and JSON?
CSV is flat: rows and columns, no hierarchy, and no way to know whether the cell reading 34 is a number or a piece of text. JSON records that type explicitly and can nest one structure inside another. The conversion matters the moment spreadsheet data has to be handed to something that expects structure — an API, an import screen, a script. Going the other way costs you nothing but gains you nothing either, so convert when a program is the consumer and stay in CSV when a person with a spreadsheet is.
Watch out for files coming from Excel
On systems where the comma is the decimal separator, Excel saves CSV with semicolons. With the delimiter on automatic this resolves itself; set it by hand only when a file mixes conventions and the guess comes out wrong.
A file may also start with an invisible BOM marker. The tool strips it — without that, the first column name would come out with a stray character glued to the front and every lookup on that key would silently fail.
Which cells become numbers, and which stay text?
With number conversion on, a cell is converted only when its reading is beyond doubt. 34, -3 and 12.5 qualify. 1,234 does not: in an English-language file that is one thousand two hundred and thirty-four, while a file written on a continental European system means one point two three four by it. Nothing in a CSV file says which convention produced it, so the tool refuses to guess and keeps the cell as text. A wrong guess would move the value by a factor of a thousand and nothing on screen would tell you.
The rule is simple: exactly three digits after the separator (1,234 or 1.234) could be a thousands group, so the cell stays text. One or two digits (12.5, 3,75) can only be a decimal fraction, because a thousands group is always three digits, so the value is converted. The same caution applies to codes with a leading zero (007, 0044) and to digit strings longer than 15 characters: converting them would drop the zero or blank out the last digits of an account number.
If those columns really are quantities, strip the thousands separators before you paste, or do the arithmetic where the data lands. If you want every column left alone, set "Convert numbers" to No; true and false then come out as text as well.
- 34 · -3 · 12.5 · 3,75 → number
- 1,234 · 1.234 (a three-digit group) → text, the reading is ambiguous
- 007 · 0044 → text, the leading zero carries meaning
- digit strings longer than 15 characters → text, precision would be lost
Array of objects, or array of arrays?
An array of objects is what most APIs and database importers want: each row becomes a record of key-value pairs, and the column order stops mattering.
An array of arrays keeps the header row as data and preserves position, which is the right choice when the consuming code addresses columns by index or when you need the file to round-trip back to CSV unchanged.
Frequently asked questions
How do I convert CSV to JSON?
Paste the data into the left pane; the result appears in the right pane as you type. You can copy it or download it as a .json file.
Are semicolon-separated files supported?
Yes. The delimiter is detected automatically, and you can also pick comma, semicolon, tab or pipe from the list if the guess is wrong.
Why was 1,234 not converted to a number?
Because that spelling has two readings: one thousand two hundred and thirty-four in an English-language file, one point two three four in a file written where the comma is the decimal mark. The tool keeps the cell as text instead of guessing, since the wrong guess changes the value by a factor of a thousand without any warning. Values with one or two decimal places (12.5) have a single reading and are converted.
Are CSV files from old Macs or legacy systems read correctly?
Yes. Files that end their lines with a bare carriage return (CR) are split into rows properly. Such files look like a single long line in many tools and no error is raised; here the row count in the status line lets you confirm that every record arrived.
Will a comma inside a field break the result?
No. Quoted fields are parsed correctly, and any comma or line break inside the quotes is kept as part of the value.
Is my data sent anywhere?
No. Parsing runs in your browser and what you paste never reaches a server, which is why the tool still works with the network disconnected.