CSV to JSON Converter
Paste JSON or CSV on the left, pick the direction with the tab, and read the converted text on the right. Everything runs in this browser tab.
Converter workspace
One block per column the converter found, in first-seen order; the label under the map reports how many records were read.
Rules used here: JSON must be an array of objects, one object, or an object whose first array-valued property holds the records; nested objects become dot paths while arrays stay JSON text; CSV follows RFC 4180 with CRLF rows, quoted fields and doubled inner quotes, and a leading BOM is ignored on read.
How the CSV to JSON converter works
Paste a table into the input box and the converter reads the first row as the property names, then turns every later row into an object with those keys. The result is pretty-printed JSON that you can copy or download as converted.json. The tab above the tool switches to the opposite direction when you need JSON to CSV instead, and both directions share the same options panel.
Quoted cells, delimiters and line breaks
The reader follows RFC 4180, the same convention spreadsheet exports use. A cell may be wrapped in double quotes, an inner quote is written twice, and a quoted cell may contain the delimiter or a line break without splitting the row. The delimiter list offers the comma, the semicolon common in European locales, and the tab used by .tsv files; the automatic option counts separators in the first line and picks the most common one. A leading byte order mark is ignored, so a file saved from Excel does not produce a column named with a stray character.
Text or typed values
By default every value stays a string, which is what you want for postal codes, phone numbers, account references and anything else with leading zeros. Turning on the type option converts a cell to a number, true, false or null only when the text survives the round trip exactly: 42 becomes a number, while 007, 3.50 and 1e3 stay text because writing the number back would not reproduce the original characters.
Rows that do not match the header
A row with fewer cells than the header gets empty values for the missing keys instead of shifting the row, so the property names stay aligned. A row with more cells than the header keeps only the cells the header can name, and the tool flags that input as ragged so you can fix the source. Blank lines are skipped, and a header cell with no text is given a positional name such as column2.
A CSV to JSON example
The sample table holds the header name,role,city,started and three rows. The output is an array of three objects, each with those four properties in the same order, indented with two spaces. With the type option on, the started column still stays text, because a year such as 1843 is short enough that some readers treat it as a number while others keep the leading characters; check what your own consumer expects before switching types on.
What CSV cannot carry
A table has one value per cell, so a JSON structure with nesting does not survive a round trip through CSV and back. Nested values become JSON text inside a cell, which keeps the characters but not the shape. When the shape matters, keep the original JSON as the source of truth and treat the CSV export as a flat view for spreadsheets and imports.
Privacy and size limits
The conversion runs in this browser tab with JavaScript and sends no request to a server, so pasted data stays on the device. The reader accepts up to 5000 rows per run and reports an error above that limit; split larger exports into parts. The file button and the drop area read a chosen .csv or .tsv file as text locally, and the download button saves the JSON result as a file.
Turning the result into a document with a word budget? See how to check word count in Google Docs.
Frequently asked questions
How do I convert CSV to JSON online?
Paste the table into the input box and the JSON appears in the output pane as you type, or press Convert to re-run it after a change. The first row supplies the property names and each later row becomes one object. Use the copy button or download the result as converted.json.
What does the CSV to JSON converter do with the header row?
The first non-blank row is treated as the header. Each cell of that row becomes a property name, trimmed of surrounding spaces, and a header cell with no text is named by its position such as column2. Later rows are matched to those names by position, so a short row leaves empty values rather than shifting the data.
Can I convert CSV to JSON format without a server?
Yes. The parser and the JSON writer both run in this browser tab, and the page makes no request with your data. Choose a file with the file button or drop it onto the input box and the browser reads it locally as text.
How do I handle a semicolon or tab separated file?
Leave the delimiter on automatic and the converter counts separators in the first line to choose between comma, semicolon and tab. You can also force the delimiter from the list when a file mixes conventions, for example when a quoted field contains commas but the file itself is semicolon separated.
Should the JSON values be numbers or text?
Text is the safer default: it preserves leading zeros, long identifiers and version-like values such as 3.50. Switch on the type option when the columns hold plain numbers or booleans and the consumer expects JSON types; a value is converted only when writing it back would produce exactly the same characters.
Why is a row missing cells in the JSON output?
The header defines the keys, so a row that has fewer cells than the header gets an empty value for each missing key. Check the input for a stray line break inside a cell that was not quoted, or for a trailing delimiter that split one row into two.
Is there a CSV to JSON converter for large exports?
The reader accepts up to 5000 rows per run and stops with a message above that limit, because the whole text is held in the browser. For larger exports, split the file into parts and convert each part, or run the conversion in your own script when you need to process millions of rows.
Where can I count the words in the JSON text I just produced?
If the output goes into a document or a report with a word budget, the Google Docs word count guide on this site explains the Tools menu, the keyboard shortcut and the counter that stays on screen while you type.