Skip to content

CSV to JSON Converter

Convert CSV to JSON or JSON to CSV with header inference, custom delimiters, and proper RFC 4180 quoting.

In your browseryour files never leave your device.

Learn more
Samples⌘Enter run · ⌘⇧C copy
Output will appear here…

About this tool

CSV looks simple from a distance and is full of edge cases up close. RFC 4180 defines the rough rules (commas separate, double quotes escape, embedded quotes are doubled) but real-world CSV is messier — Excel emits BOMs at the start of UTF-8 files, European exports use semicolons and decimal commas, embedded newlines inside quoted fields are common in user-generated data, and the same column can contain numbers in some rows and strings in others. This converter uses PapaParse, the most battle-tested CSV library in JavaScript, which handles all of those edge cases correctly. Toggle between CSV-to-JSON and the reverse direction. Pick a delimiter. Tell it whether the first row is headers. Output is JSON with proper types (numbers become numbers, booleans become booleans) when headers are on, or arrays of arrays when they are off.

How to csv to json converter

  1. Paste your data

    CSV rows for CSV-to-JSON. JSON array (of objects or of arrays) for JSON-to-CSV. The input box is multi-line and accepts large pastes. For very large files (millions of rows), the browser may slow noticeably but PapaParse handles the parsing efficiently even at scale.

  2. Set delimiter and header

    Pick comma, semicolon, tab, or pipe from the delimiter dropdown — or choose "Custom…" and type any single character. Toggle whether the first row is headers. The parser re-runs on every change so you see the effect immediately — useful when the right delimiter is not obvious (a file claiming to be CSV that is actually semicolon-separated).

  3. Read the converted output

    JSON or CSV appears in the output box, with row and column counts shown so you can sanity-check that no rows were dropped or merged. If parsing fails, an error message points to the problem row.

  4. Copy and use it

    One-click copy sends the output to your clipboard. Paste into your import script, your fixtures file, your API call, your data analysis tool, or wherever the converted format needs to go.

Features

Bidirectional conversion

CSV to JSON in one direction, JSON to CSV in the other. Toggle at the top. Same input box, same output box, no need to learn two interfaces. Switching directions clears the input so you do not accidentally try to parse one format as the other. The conversion is symmetric in the sense that a round-trip (CSV → JSON → CSV) preserves data, though it may reformat whitespace and quoting.

Configurable delimiter

Comma is the default. Semicolon for European CSVs (where comma is the decimal separator and the same character cannot be used for both purposes). Tab for TSV files, which are common in scientific data and database dumps. Pipe for legacy data feeds. A "Custom…" option accepts any single character — caret, tilde, ASCII 0x1F unit separator, whatever your weird upstream emits. The parser handles each correctly including the quoting rules around them — embedded delimiters inside quoted fields do not break the parse, which is the whole point of RFC 4180 quoting.

Header row toggle

With Header on, the first row becomes the keys of each JSON object — output is an array of objects with named fields, which is what almost every API expects. With Header off, output is an array of arrays where you address columns by index. Pick based on what your downstream consumer wants. The header toggle also affects the reverse direction: with Header on, JSON-to-CSV writes a header row from the first object's keys; with Header off, it writes data rows only.

Type inference

Numbers and booleans are detected and converted from strings during CSV-to-JSON. So "30" becomes 30 (not "30"), "true" becomes true, "false" becomes false, empty strings become null or empty. Dates remain strings because the format is ambiguous (US MM/DD/YYYY vs ISO YYYY-MM-DD vs European DD/MM/YYYY) and silent auto-parsing causes more bugs than it solves. If you need typed dates, parse them downstream where you know the format.

Frequently asked questions

What encoding does this expect?
UTF-8, which is the only modern reasonable answer. Excel on Windows occasionally emits UTF-8 with a BOM (those three byte 0xEF 0xBB 0xBF at the start) — PapaParse handles the BOM correctly and treats it as a non-character marker that some applications need. UTF-16 input is not directly supported; if your CSV starts with 0xFF 0xFE or similar, you have a UTF-16 file and should re-export as UTF-8. Latin-1 / Windows-1252 files with non-ASCII characters will display them as replacement characters; convert to UTF-8 with iconv or a similar tool first.
How does it handle embedded newlines in fields?
RFC 4180 allows newlines inside quoted fields, and the parser respects that. So a CSV with a free-text "notes" column that has paragraphs in some rows works correctly — the parser does not break the row at the newline because it sees the surrounding quotes. This is one of the cases where naive line-splitting on a CSV gives wrong results, and it is why "just split on newlines" is wrong for any non-trivial CSV file. The same applies to embedded delimiters and embedded quotes (escaped by doubling).
JSON to CSV — what shape must my JSON be in?
Either an array of objects (rows become objects, keys become column headers) or an array of arrays (rows become arrays, no headers unless you toggle them on). A bare object or scalar is not valid input — wrap it in an array first. Mixed schemas across rows (one row has a field another does not) work; the missing fields become empty cells. The column order in the output is determined by the keys of the first object; subsequent objects with extra keys may have those columns appended or may lose those keys depending on the strict-mode setting.
Why does my number column lose leading zeros?
Type inference detects "00123" as a number and writes it as 123 in JSON, because that is what the number 00123 is. If you need to preserve "00123" as a string — phone numbers, ZIP codes, account numbers, MRNs, ISBNs — you have two options: turn off type inference (not currently exposed in this tool), or pre-quote the field in your CSV (Excel quoting with leading apostrophe '00123 is one workaround). The cleanest solution is to ensure your CSV has explicit string quoting for those columns.
Large CSVs?
PapaParse handles CSVs with millions of rows efficiently — it is a streaming parser. The browser, on the other hand, has to render the output, and large JSON output in a textbox is the bottleneck. Up to a few hundred thousand rows works without trouble. Above that the output box becomes the bottleneck — for very large conversions, a CLI like miller (mlr) or csvkit is faster because they stream input to output without buffering the entire result in memory.