CSV ⇄ JSON

Free bidirectional converter · No login · Runs in your browser
Input — CSV
Output — JSON

    

How CSV to JSON Conversion Works

CSV (Comma-Separated Values) and JSON (JavaScript Object Notation) are two of the most common data interchange formats. CSV is compact and spreadsheet-friendly; JSON is hierarchical and native to web APIs. This tool lets you move between them instantly, entirely in your browser.

The CSV Format (RFC 4180)

The official CSV spec (RFC 4180) defines these rules that this converter follows exactly:

  • Fields are separated by a delimiter (default: comma). The auto-detect option checks your data and picks the right one.
  • Fields containing the delimiter, double-quotes, or newlines must be enclosed in double-quotes.
  • A double-quote inside a quoted field is represented by two consecutive double-quotes ("").
  • The first row is typically a header row naming the columns.
  • Rows are separated by CRLF or LF line endings — both work.

Type Inference

When type inference is enabled (the default), string values are automatically converted to native JSON types:

  • "42"42 (number)
  • "3.14"3.14 (number)
  • "true" / "false"true / false (boolean)
  • "" or "null"null
  • Everything else stays a string.

Turn off type inference when you need strict string output — for example, when a column of ZIP codes like 01234 should remain "01234", not 1234.

Dot-Notation Keys → Nested Objects

Enable Expand dot keys to turn a header like address.city into a nested JSON structure: {"address": {"city": "..."}}. This is useful when preparing data for a hierarchical API that expects nested objects.

JSON → CSV: Flattening Nested Objects

When converting JSON back to CSV, nested objects are automatically flattened using dot-notation keys. An object {"user": {"name": "Alice", "age": 30}} becomes two columns: user.name and user.age.

Keyboard Shortcuts

  • Ctrl/Cmd+Enter — Convert now
  • Ctrl/Cmd+D — Download output
  • Ctrl/Cmd+Shift+C — Copy output

Common CSV Pitfalls

  • Commas inside values: If your data contains commas (e.g., "Smith, John"), the field must be quoted. This converter handles this correctly per RFC 4180.
  • Inconsistent column counts: Some exporters produce rows with missing trailing fields. This converter fills missing values with null and warns you which rows are affected.
  • BOM characters: Files exported from Excel sometimes start with a UTF-8 BOM (). This converter strips it automatically.
  • Encoding: Upload files are read as UTF-8. If your CSV uses a different encoding (e.g., Latin-1), convert it to UTF-8 first.
  • Large files: Files over 5 MB may slow the preview table. The converter will process them but limit the preview to the first 50 rows.

CSV vs JSON: When to Use Which

Use CSV when: sharing tabular data with non-technical users, importing into spreadsheets, working with large flat datasets where column names are stable.

Use JSON when: working with web APIs, storing hierarchical or nested data, using JavaScript/Node.js/Python scripts, or when values may contain commas or special characters.

Frequently Asked Questions

No. All conversion happens entirely in your browser using JavaScript. Your CSV or JSON data never leaves your device. Check the browser's Network tab — you'll see zero outbound requests during conversion.
The converter samples the first 5 lines and counts occurrences of comma, semicolon, tab, and pipe. The character that appears most consistently across rows (especially in the header) is selected as the delimiter. You can always override it manually.
Yes. The parser is fully RFC 4180 compliant. Fields enclosed in double-quotes may contain commas, embedded newlines, and escaped double-quotes (two consecutive double-quotes represent one literal quote). This handles Excel exports and multi-line address fields correctly.
Array of objects (default) uses the header row as keys: [{"name":"Alice","age":30}]. This is what most APIs and libraries expect. Array of arrays preserves raw rows: [["name","age"],["Alice","30"]], useful for data grids and matrix operations.
Select your Excel cells and press Ctrl+C (they're copied as tab-separated values). Paste into the input box — the auto-detect feature recognizes the tab delimiter automatically. You can also save the Excel file as CSV (File → Save As → CSV) and upload it using the Upload button.
There is no enforced limit, but the browser may slow down above 5 MB. A warning is shown above that threshold. The live table preview is always limited to the first 50 rows for performance. The full conversion output is always complete.