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.

Why use this tool

Spreadsheet exports are the standard input. A non-technical colleague sends "the data" as a CSV download from Excel or Google Sheets, the API I am working with wants JSON, and the conversion is in the middle. The second case is import scripts: I have 500 rows of seed data in JSON for testing, but the database admin tool only accepts CSV uploads. Round-trip through this tool and the upload works. The third case is debugging a CSV that fails to import. The error message says "row 247 has 5 fields, expected 6" — I paste the row here, switch to CSV-to-JSON mode, and see exactly where the extra delimiter is hiding (usually an unescaped comma inside a free-text field that was not properly quoted). The fourth case is preparing API request bodies from spreadsheet data — sales or marketing has a list of records in Excel that needs to be POSTed to an API as a JSON array. Everything runs in the browser via PapaParse, so customer data in those CSVs never touches a third-party server.

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.

Privacy & security

This tool runs entirely in your browser. Your files are never uploaded to a server — every step of the process (reading, transforming, downloading) happens on your device using JavaScript and the Web APIs. You can verify this in your browser's network tab: clicking the tool's main action triggers zero requests to our servers. The page itself is served over HTTPS, but once it loads, your data stays put. No accounts, no tracking of file contents, no scanning your inputs.

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.
What if my JSON has nested objects?
CSV is flat by design — there is no clean way to represent {user: {id: 1, name: "x"}, items: [...]} in a 2D grid. The converter handles nested values by stringifying them: the user column gets the JSON string of the inner object. Round-tripping flat objects works correctly; deeply nested data is better served by JSONL (JSON Lines, one JSON object per line) or other formats that preserve structure. For flattening nested JSON deliberately, jq has good idioms.
Privacy?
Conversion runs entirely in your browser via PapaParse, which is included in the page bundle. The input is not transmitted to any server. Important when the data is customer records, internal exports, healthcare data, or anything with PII. Open DevTools, paste a CSV, watch the Network tab — no outbound requests. This matters more for CSV than for most tools because CSVs are often dumps of databases full of personal information.
Can it handle pipe-delimited or other custom delimiters?
Pipe is a preset option in the dropdown, and there is a "Custom…" entry that accepts any single character — caret, tilde, ASCII 0x1F unit separator, anything PapaParse can use as a single-character delimiter. The custom value is captured as one character (maxLength enforced) and persists into the URL hash and localStorage along with the other settings, so a shared permalink carries your delimiter choice. For real CSV work with unusual delimiters and very large files, miller or csvkit on the command line is faster because they stream input to output, but this tool covers everything that fits in memory.
What about quoted-printable encoding or other esoteric formats?
Those are not CSV — they are email content encodings. The parser expects plain text with standard CSV escaping. If you have data that came through email and is quoted-printable encoded (lines ending in = and special characters as =HH), decode it first with a quoted-printable decoder before pasting here.