CSV JSON Converter
Convert between CSV and JSON data formats. Free, fast, and works entirely in your browser with no sign-up required.
Updated
CSV ↔ JSON Converter
Bidirectional conversion between CSV and JSON. Supports auto-detection, type inference, nested object flattening, table preview, and column analytics.
Options
Input — CSV
CSV → JSON Features
- Auto-detects delimiter (comma, semicolon, tab, pipe)
- RFC 4180-compliant quoted field parsing
- Type inference: numbers, booleans, null
- Header row or indexed arrays
- Configurable JSON indentation (2, 4, 8 spaces)
- Inconsistent column count warnings
- Unclosed quote detection
JSON → CSV Features
- Array of objects with any key set
- Nested object flattening (dot notation)
- Arrays stored as JSON strings in cells
- Configurable output delimiter
- Proper cell escaping (commas, quotes, newlines)
- Optional header row generation
- Missing key graceful handling
Privacy First: All conversion happens entirely in your browser. Your data is never uploaded to any server.
Frequently Asked Questions
How do I convert a CSV file to a JSON array of objects?
Paste your CSV or upload the file, keep "first row is header" turned on, and the converter reads each remaining row as one object whose keys come from that header line. The result is a JSON array of objects, the same shape most APIs expect for a list of records. If you turn the header option off, you get an array of arrays instead, preserving raw row order without named keys. Blank header cells fall back to predictable names like column1 and column2 so nothing is dropped. The delimiter is auto-detected from the first line, or you can set comma, semicolon, tab, or pipe yourself, and you can pretty-print with 2, 4, or 8 spaces of indentation. Paste your data above and click convert to get clean, copy-ready JSON in one step.
Why are numbers and true/false values quoted as strings in my JSON output?
CSV has no concept of data types, so every cell arrives as plain text. If type inference is switched off, the converter plays it safe and keeps each value exactly as written, which means 42 and true become the strings "42" and "true" in your JSON. Turn type inference on and the parser promotes whole numbers to integers, decimals like 3.14 to floats, true and false to real booleans, and empty, null, or n/a cells to JSON null. That gives you output your code can use directly without a second cleanup pass. The trade-off is that values such as zip codes or IDs with leading zeros may lose them once read as numbers, so leave inference off when you need every character preserved. Toggle the type inference option above to match how your downstream tool expects the data.
How does the converter handle nested JSON objects when exporting to CSV?
A flat CSV table cannot hold a nested structure directly, so the converter offers a flatten option that maps nested keys into dot notation. An object like {"address": {"city": "NYC"}} becomes a single column named address.city, and deeper nesting keeps chaining with more dots. Arrays inside a record are preserved as JSON strings packed into one cell rather than spread across columns, so no data is silently lost. The tool scans every object first, collects the complete set of keys in the order they first appear, and writes one column per key, so records missing a field just get an empty cell instead of breaking row alignment. With flatten turned off, nested objects are written as JSON text in their column. Pick the output delimiter you need, enable flatten if your JSON has nested objects, and convert to a tidy table.
What is the difference between auto-detecting the delimiter and setting it manually?
When auto-detection is on, the converter inspects the first line of your CSV and counts how often commas, semicolons, tabs, and pipes appear, then picks whichever is most common as the separator. That works well for ordinary exports, but it can guess wrong on files where a quoted field happens to contain many commas or where the header is unusually short. Setting the delimiter manually removes that ambiguity: you tell the tool exactly which character splits your columns, including space-separated data that auto-detection might not expect. European exports often use semicolons because the comma is a decimal mark, while tab-separated files are common from spreadsheets, so manual control matters across regions. If your first conversion looks misaligned, switch from auto to the exact delimiter your file uses and convert again for correct columns.
How does the converter parse quoted fields that contain commas or line breaks?
The parser follows the RFC 4180 convention used by spreadsheets and most data exports. Any field wrapped in double quotes is treated as a single value even when it contains the delimiter or a line break, so a cell like "Smith, John" stays in one column instead of splitting into two. A doubled quote inside a quoted field, written as "", is read as one literal quote character rather than ending the field early. This is what lets addresses, descriptions, and multi-line notes survive a conversion intact. If a quote is opened but never closed, the tool reports it as an error so you can fix a malformed file rather than receiving silently wrong output, and rows with an unexpected column count are flagged as warnings. Paste a tricky CSV above and the column info tab will show you exactly how each field was parsed.
Related Tools
Free Secure Password Generator
Generate secure, random passwords with customizable options. Free, fast, and works entirely in your browser with no sign-up required.
Free UUID/GUID Generator
Generate universally unique identifiers (UUIDs/GUIDs). Free, fast, and works entirely in your browser with no sign-up required.
Free QR Code Generator Online
Create QR codes for URLs, text, WiFi, and contacts. Customize colors, size, and error correction. Free, private — runs in your browser, no sign-up.
Free JSON Formatter & Validator
Format, validate, and beautify JSON data with syntax highlighting and error detection. Free, fast, and works entirely in your browser with no sign-up required.
About the CSV JSON Converter
The CSV JSON Converter turns tabular CSV data into structured JSON and JSON back into a flat CSV table, in both directions, without leaving your browser. Paste your data or upload a file, pick a few options, and click convert — you get clean output plus a table preview and a column-by-column breakdown of what was parsed. It is built for developers wiring up APIs, analysts moving data between spreadsheets and code, and anyone who has been handed a file in the wrong format and just needs it in the other one.
Every conversion runs locally on your device. Nothing you paste or upload is sent to a server, so exported customer lists, internal records, or unreleased datasets stay on your machine. There is no sign-up, no row limit imposed by an account tier, and no software to install.
Converting CSV to JSON
In CSV → JSON mode the tool parses your rows into an array of objects (or an array of arrays if you turn off the header option). A few choices control the result:
- Delimiter — auto-detection inspects the first line and picks comma, semicolon, tab, or pipe based on which appears most; you can also set it manually, including space-separated data.
- Header row — when "first row is header" is on, those values become the JSON keys; blank headers fall back to
column1,column2, and so on. - Type inference — instead of quoting everything as a string, the converter promotes
42to a number,3.14to a float,true/falseto booleans, and empty,null, orn/acells to JSONnull. Turn it off to keep every value as a string. - Indentation — pretty-print the JSON with 2, 4, or 8 spaces.
The parser follows the RFC 4180 convention for quoted fields: text wrapped in double quotes can contain commas and line breaks, and a doubled "" is read as a single literal quote. Rows with an unexpected column count are flagged as warnings, and an unclosed quote is reported so you can spot a malformed file rather than getting silently wrong output.
Converting JSON to CSV
JSON → CSV expects an array of objects, the shape most APIs return for a list of records. The converter scans every object, collects the full set of keys in the order it first sees them, and writes one CSV column per key — so rows with missing fields simply get an empty cell rather than breaking the alignment.
Nested objects are the common snag, and the flatten option handles them with dot notation: {"address": {"city": "NYC"}} becomes a column named address.city. Arrays are preserved as JSON strings inside a single cell. Cells that contain the delimiter, a quote, or a newline are automatically escaped in double quotes, and you can choose comma, semicolon, tab, or pipe as the output delimiter and toggle whether a header row is written.
Preview, column info, and exporting
Beyond the raw text output, two extra tabs help you trust the result. The table preview renders the first 10 rows as a real grid so you can eyeball the structure, and the column info view reports each field's detected type, how many values are null, how many are unique, and a few sample values — a quick way to spot a column that parsed as mixed types or has unexpected blanks.
When the output looks right, copy it to the clipboard or download it as a .json or .csv file. The Swap & Continue button feeds the output straight back into the input and flips the mode, so you can round-trip a file or chain conversions without re-pasting.
Why format conversion matters
CSV is the lingua franca of spreadsheets and data exports, while JSON is the native format of web APIs, config files, and most modern tooling — and the two rarely meet without a translation step. Converting by hand is error-prone: a stray comma inside a quoted value, an inconsistent row, or a nested object can quietly corrupt the result. Doing it here gives you correct quoting and escaping, visible type information, and warnings when something does not line up, so the data arrives in the next tool ready to use.