CSV to JSON
Convert CSV data to JSON arrays. Header detection, custom delimiters, quoted fields, and embedded newlines handled.
Enter input above to see the result.
What is this for?
CSV is the lingua franca of spreadsheet exports; JSON is the lingua franca of APIs and config. This converter takes properly-quoted CSV (RFC 4180-compatible) and emits a JSON array — either an array of objects (when there's a header row) or an array of arrays. Useful when you've exported a sheet and need to feed it into something that talks JSON.
When to use it
- Turning a one-off Google Sheets or Excel export into seed data for an API mock, test fixture, or database initialisation script.
- Loading reference tables (countries, currency codes, timezone data, lookup tables) into a frontend that consumes JSON.
- Inspecting a CSV with embedded commas, newlines, or quotes that gets mangled by naive CSV parsers or spreadsheet applications.
- Preparing bulk data exports for use in static site generators, config file generation, or data processing pipelines.
- Converting legacy or third-party CSV outputs into a format your application or API expects.
- Quickly validating that a CSV file parses correctly according to RFC 4180 before feeding it to a stricter consumer.
How it works
- Paste or upload your CSV. The tool accepts input via text area or file upload; it runs entirely in your browser with no server-side processing.
- Set your delimiter. The default is comma, but you can select semicolon (common in EU locales), tab (TSV), or pipe if your data uses a different separator.
- Header row detection. If your CSV has a header row, the converter treats it as keys in the output objects. If not, you get an array of arrays instead.
- Parse and transform. The parser respects RFC 4180 quoting rules: quoted fields preserve literal commas and newlines, and escaped quotes (
"") inside quoted fields are unescaped. - Optionally apply type coercion. Numbers, booleans, and null values can be converted to their JSON equivalents, or left as strings for manual post-processing.
Common gotchas
- Delimiter detection isn't magic. If your file uses semicolons (common in EU locales) or tabs (TSV), manually select the right delimiter from the dropdown. Auto-detection can be fooled by data that happens to contain other delimiters.
- Type coercion is opinionated. When enabled, numeric strings,
true,false, and literalnullare converted to JSON types. Things that look numeric but aren't (zip codes, ISBNs with leading zeros, phone numbers) lose leading zeros. Disable coercion or post-process if this is a problem. - Empty cells become empty strings, not
null. Most APIs and databases treat these differently; if you need true nulls, post-process the JSON or use a search-and-replace on empty strings. - BOMs in the wild. Excel often saves UTF-8 with a byte-order mark on Windows; this parser tolerates it, but downstream JSON consumers may choke. Try a BOM stripper if your output fails to parse elsewhere.
- Large files can freeze your browser. This tool processes everything client-side; files over 10 MB may cause performance issues. For very large CSV, consider splitting or using a server-side tool.
Output formats
- Array of objects (recommended when a header row exists): Each row becomes an object with header names as keys. Clean for APIs and templates.
- Array of arrays (when no header row is detected): Rows become nested arrays. Compact but less self-documenting; use when headers are absent or column order is critical.