CSV β JSON Converter
Convert CSV to JSON (array of objects) or JSON to CSV β quoted-field aware, runs in your browser.
Tool code processes selected files and entered content in your browser and does not submit them to a TOOLGRID processing endpoint. TOOLGRID measures tool usage, not the content you enter.
Loading toolβ¦
Browser-basedWhat this tool does
In-browser CSV β JSON converter with header-row toggle, RFC 4180 quoting, and column inference.
CSV β JSON parses RFC 4180-style CSV: comma-separated fields, quoted fields (with "" as an embedded quote escape), and both LF and CRLF line endings. With "First row is the header" set to Yes (default), the parser uses row 1 as object keys and emits a JSON array of objects. Set to No to get a JSON array of arrays instead β useful when there's no header row or when you want raw positional data.
JSON β CSV accepts an array of objects (the format CSV β JSON produces). The converter walks every object to collect the full set of keys, uses that as the header row, and emits one CSV row per object. Values containing commas, quotes, or newlines are auto-quoted with "" escaping. Non-string values (numbers, booleans, null, nested objects) are JSON-stringified into the cell.
What you can do with this tool
Export a Google Sheets / Excel sheet as CSV, paste it in, and copy the JSON array of objects to send as a request body or seed a development database.
Application logs sometimes ship as CSV. Convert to JSON to inspect specific rows with a JSON viewer's structure, search, and filtering β much easier than reading raw rows.
Some non-developer stakeholders prefer CSV/Excel over JSON. Take the JSON response from your API, paste it in, and hand back a CSV they can open in Excel.
What to check before relying on the result
- Performance and maximum practical input size depend on browser memory, device speed, and the structure of the input.
- Review the generated result before replacing or publishing an original file.
How to use
- 1
Choose CSV, JSON, or Markdown table as the source and a different target format.
- 2
Paste the source content and resolve any quoting, header, divider, or row-width error shown in the status card.
- 3
Review the row count and inferred columns, then copy the generated output. For CSV β JSON only, choose whether the first row is a header.
Use Cases
Export a Google Sheets / Excel sheet as CSV, paste it in, and copy the JSON array of objects to send as a request body or seed a development database.
Application logs sometimes ship as CSV. Convert to JSON to inspect specific rows with a JSON viewer's structure, search, and filtering β much easier than reading raw rows.
Some non-developer stakeholders prefer CSV/Excel over JSON. Take the JSON response from your API, paste it in, and hand back a CSV they can open in Excel.
When moving data between systems (DB to DB, SaaS to SaaS), you often need to translate between row-oriented CSV exports and document-oriented JSON imports. This tool handles the round-trip quickly without writing a script.
When mocking up data for a prototype or test, it's faster to type in CSV (or paste from a spreadsheet) than to write JSON by hand. Convert when you're done and use the JSON as a fixture.
Tips & Tricks
If your CSV has cells that contain commas (a price like "1,200" or a sentence), those cells must be wrapped in double quotes. Embedded quotes inside a quoted cell use <code>""</code> as the escape. The parser handles both β but if your source data uses single quotes or escaped backslashes instead, those won't decode correctly.
If your JSON array has objects with different shapes, the CSV header includes every key seen anywhere. Missing keys produce empty cells in their column. This is usually what you want β but it can produce surprisingly wide CSVs if your JSON is sparse.
Numbers, booleans, null, nested objects, and arrays are serialized into CSV cell text. A later CSV β JSON conversion returns those cells as strings; it does not restore their original JSON types or nested structure.
CSV has no native JSON type system, so JSON β CSV β JSON is not type-preserving: numbers, booleans, null, objects, and arrays can return as strings. Non-RFC quoting conventions can also change or fail to parse.
FAQ
Does the converter run entirely in my browser?
Both directions use pure JavaScript β JSON.parse / JSON.stringify for the JSON side, and a small custom RFC 4180-style CSV parser for the CSV side. Tool code does not submit entered input or output to a TOOLGRID processing endpoint. Review browser extensions and device security before handling sensitive exports.
What CSV format does the parser handle?
Comma-separated values with optional double-quoted fields and <code>""</code> as the embedded-quote escape (the RFC 4180 / Excel convention). Both LF and CRLF line endings work. Tab-separated (TSV) and other delimiters are not supported in this tool β paste TSV into a spreadsheet first to re-export as CSV, or use a search-and-replace step.
What does "First row is the header" do?
When Yes (default), CSV β JSON treats row 1 as object keys: <code>name,age</code> produces objects like <code>{name: ..., age: ...}</code>. When No, it emits a JSON array of arrays (positional, no keys). Pick No if your CSV has no header or you want raw rows for downstream column processing.
How does JSON β CSV decide what columns to include?
The converter walks every object in the array and collects the union of all keys. Each object then produces one CSV row, filling its known keys and leaving missing-key cells empty. If your JSON has heterogeneous objects, the output is wide; if all objects share the same shape, the output is clean.
Can the tool handle nested JSON objects in CSV cells?
Nested objects and arrays inside the JSON are JSON-stringified into the CSV cell value (so they appear as <code>{...}</code> text). The CSV side stays flat β true hierarchical export would need a different format (e.g., JSON Lines or a nested CSV convention). For most reporting and API-handoff use cases, the flat output is what you want.
What's the maximum input size?
Input size is not governed by a published server quota. The practical limit is browser memory and main-thread performance. Test representative files; for very large CSV/JSON, use a streaming command-line tool such as <code>jq</code>, <code>csvkit</code>, or <code>miller</code>.
Why is my JSON-to-CSV erroring with "expects an array (of objects)"?
JSON β CSV requires the top-level JSON value to be an array of objects (the format CSV β JSON produces). If your input is a single object, wrap it in <code>[ ... ]</code>. If it's an array of arrays or array of primitives, restructure to objects first β or convert directly via spreadsheet software which handles those shapes.
Useful next steps
Open a nearby browser tool when you need to validate, convert, or reuse the result.