CSV to JSON Converter & JSON to CSV Online
Paste or upload a CSV (comma, semicolon, tab or pipe) and get clean JSON. Also converts JSON to CSV that Excel opens without garbled characters.
Updated November 2026
Reviewed by Rafael Duarte
How to convert CSV to JSON
One converter, two directions — CSV to JSON or JSON to CSV
1. Pick a direction
Switch between CSV → JSON and JSON → CSV with the toggle at the top.
2. Paste or upload your file
Paste data directly, or upload a .csv, .tsv or .txt file (CSV → JSON) or a .json file (JSON → CSV). The file is read in your browser.
3. Configure and export
Set the delimiter, Has Headers, the ARRAY or OBJECT output and Infer Types, then copy the result or download it as output.json or output.csv.
What this CSV to JSON converter does
Real-world CSV quirks, handled automatically
Automatic delimiter detection
With Auto-detect, the tool counts commas, semicolons, tabs and pipes in the first line and shows the result as "detected: …". One delimiter is used for the whole file, and you can pick it by hand if the header row misleads the detection.
Quoted fields handled correctly
Commas and line breaks inside quoted CSV fields don't break the parsing.
Optional type inference
When enabled, turns "42" into the number 42 and "true" into a boolean, while leading zeros such as 00184 stay text, so ZIP codes and IDs survive.
Nested JSON flattening
{"user":{"name":"John"}} becomes the user.name column when converting JSON to CSV.
Excel-friendly encoding
An uploaded file that isn't valid UTF-8 is read as Windows-1252, common in CSV files saved by Excel on Windows, so accented characters come through intact. The downloaded CSV starts with a UTF-8 BOM, so Excel opens it with the right characters.
Array or object output
Get an array of row objects (ARRAY) or one object keyed by the first column's value (OBJECT), handy for lookups by ID.
Examples
What goes in, what comes out
name,age\nJohn,30[{"name":"John","age":"30"}]{"John":{"name":"John","age":"30"}}{"user":{"name":"John"}}user.name"42"42 (number, not string)"00184""00184" (leading zeros kept)When you'll reach for this tool
The most common scenarios people use it for
Feed spreadsheet data into a REST API
Convert CSV to JSON to import records into MongoDB, Firestore or any JavaScript app.
Export an API response to Excel
Convert JSON to CSV to share structured data with non-technical teammates or analysts. The downloaded file carries a UTF-8 BOM, so it opens in Excel with the right characters on a double-click.
ETL and data pipelines
Convert a sample to check the structure before you write the real parser. For files too big for a browser tab, see Large CSV in JavaScript: Convert to JSON Without Freezing.
Feed BI and dashboard tools
Convert JSON to CSV so Tableau, Power BI or Looker can ingest it directly.
Common mistakes
CSV with no header row
Uncheck "Has Headers" if your CSV has no header line — otherwise the first data row is treated as column names.
Wrong delimiter from European Excel exports
Excel in many European locales exports CSV with semicolons instead of commas. Auto-detect handles this case, and in JSON → CSV you can choose Semicolon (;) as the output delimiter for the same audience.
Duplicate keys in OBJECT output
OBJECT output uses the first column as the key. If two rows share that value, the later row overwrites the earlier one with no warning, so use ARRAY unless the first column is a unique ID.
Expecting arrays to become columns
Nested objects are flattened at any depth (a.b.c), but arrays are not — they are stored as a JSON string in the cell.
Why use this converter
It handles the real-world edge cases of CSV: comma, semicolon, tab or pipe delimiters detected from the header row, quoted fields with embedded commas, escaped "" quotes and line breaks inside values.
It also deals with what Excel does to CSV files: Windows-1252 uploads are decoded without garbled characters, and the CSV you download carries a UTF-8 BOM. How to Import CSV Files Without Corrupting Characters explains why both matter.
Everything runs client-side in your browser. No file is ever uploaded to a server, which matters when you're converting spreadsheets or API payloads with sensitive data. If the JSON is headed into a pipeline, ETL vs ELT and How to work with large files without running out of memory cover the next steps.
Frequently asked questions
CSV is flat and tabular, organized as rows and columns separated by a delimiter. JSON is structured and hierarchical, built from key-value pairs and arrays that can nest inside each other. CSV is the natural fit for spreadsheets, while JSON is the standard format for APIs and web applications.
The first row is treated as the header row by default, and each column name becomes a JSON key in the output. If your CSV doesn't have a header row, uncheck "Has Headers" to get raw arrays instead of keyed objects.
Yes. The converter auto-detects comma, semicolon, tab and pipe delimiters from the first line, and you can also set the delimiter manually, which helps with CSV files exported from European versions of Excel that use semicolons. A file is parsed with a single delimiter, so mixed separators in one file aren't supported.
Yes. Switch Output to OBJECT and each row is stored under the value of its first column, like {"1": {...}, "2": {...}}. Rows that share the same first-column value overwrite each other, so keep ARRAY if that column isn't unique. Without headers, the keys are the row numbers starting at 0.
Garbled text usually means the file was saved as Windows-1252 and read as UTF-8. When you upload a file that isn't valid UTF-8, the tool decodes it as Windows-1252 instead. In the other direction, the downloaded CSV starts with a UTF-8 BOM so Excel detects the encoding on a double-click.
Nested objects are flattened into columns using dot notation, so {"user":{"name":"John"}} becomes a column named user.name. Every level of nested objects is flattened this way (a.b.c); only arrays are kept as a JSON string inside the cell.
It detects the native type of each field instead of leaving everything as a string — 42 becomes a number, true/false become booleans, and empty fields become null. Only plain JSON-style numbers are converted: values with leading zeros like 00184, hex like 0x1A and integers above 2^53 stay text, so ZIP codes, IDs and long account numbers aren't altered. It's off by default and useful when the JSON is headed for an API or database that enforces strict types.
Yes — the conversion runs entirely in your browser using JavaScript. Your file is never uploaded or sent to a server, so it's safe to use with private spreadsheets, customer data or internal API responses.
References
Related Tools
- JSON Formatter & Validator: Fix Errors, Tree View Developer Format, validate and minify JSON with errors shown by line and column, one-click fixes for trailing commas and quotes, and tree or graph views.
- YAML to JSON Converter & JSON to YAML Online Developer Paste YAML from docker-compose, Kubernetes or GitHub Actions and get JSON instantly, with anchors expanded and multi-document files (---) as an array.
- JSON to TypeScript: Generate Interfaces or Types Online Developer Paste JSON and get TypeScript interfaces or types, with nested objects and optional fields inferred from every array item. Also repairs broken JSON.
- ASCII Table Generator: Plain-Text & Markdown Tables Developer Turn CSV or typed data into a plain-text table: MySQL, Unicode box, rounded, double-line, Markdown, RST or minimal style. Copy it or download as .txt.
- Base64 Decode Online — Free Base64 to Text Decoder Developer Free online Base64 decoder — decode Base64 strings back to plain text instantly in your browser. Validates input and shows decoded payload size.