inyourbrowser.com

CSV ↔ JSON Converter

CSV to JSON converter is a data tool that turns comma-separated rows into a JSON array of objects and converts JSON arrays back to CSV. It uses the header row as keys, parses quoted fields with embedded commas, quotes, and line breaks per RFC 4180, and downloads the result as a .json or .csv file. The tool runs in your browser.

CSV Input
Output

CONVERT

Comma-separated input. First row is used as object keys. Quoted fields with commas are handled correctly.

Runs entirely in your browser

How to convert CSV to JSON

  1. Paste your comma-separated data into the input area.
  2. The first row is always used as the keys. If your CSV has no header row, add one before pasting.
  3. The output is a JSON array with one object per data row.
  4. Click "Copy" or "Download" to get the converted JSON.

Common uses

  • Converting data exports from spreadsheet applications to JSON for APIs, then format the JSON output for readability
  • Transforming CSV reports into JSON for JavaScript applications
  • Preparing data for import into a database or no-code platform that expects JSON, use Base64 encoding if you need to embed the data in a text-only payload

Technical specification

  • Algorithm or formula: Custom hand-written CSV parser that handles quoted fields, escaped double quotes (""), embedded commas, and CRLF or LF line endings per RFC 4180. JSON output uses JSON.stringify with two-space indentation.
  • Browser API or library: Native JSON.parse and JSON.stringify. No external parsing library.
  • Input limits: Bounded by browser memory. Multi-megabyte CSV converts quickly on modern devices.
  • Output: JSON array of objects, one per data row, keyed by the header row. A repeated header name gets a numeric suffix (for example a_2) so no column is lost. The reverse direction emits comma-delimited CSV with one column for every key found in any object. Cells starting with =, +, -, @, a tab or a carriage return get a leading single quote so spreadsheets treat them as text.
  • Known limitations: Only comma delimiters are supported. A value in a column past the last header has no key, so it is left out, and the tool shows a warning when that happens. Nested objects and arrays are not flattened into columns; they are written as JSON text in a single cell, so they come back as text when converted to JSON again.

Frequently asked questions

What delimiters and conversion directions does this tool support?
Both directions: CSV to JSON and JSON to CSV. The tool reads and writes comma-separated values. Semicolon- or tab-separated data is read as a single column, so replace those separators with commas before pasting. Quoted fields containing commas, newlines, or quotes are parsed per RFC 4180.
Is my CSV data uploaded anywhere?
All conversion happens in your browser. Our servers are not involved at any point.
Are numbers and true/false kept as JSON types?
CSV carries no types, so every value in the JSON output is a string: 30 becomes "30" and true becomes "true". Convert the fields you need in your own code afterwards.
Why do some CSV cells start with a single quote?
When converting JSON to CSV, cells that begin with =, +, -, @, a tab, or a carriage return get a leading ' so spreadsheet apps treat them as text rather than formulas.

Related tools

JSON formatter
Pretty-print, minify, validate, and sort JSON keys. Instant output.
YAML formatter
Format, validate, and convert YAML. Compatible with Kubernetes, CI configs, and OpenAPI files.
XML formatter
Pretty-print, minify, and validate XML. Uses the browser's native DOMParser.
Sort lines
Sort lines alphabetically, by length, or shuffle randomly. Remove duplicates and empty lines in one click.

Reviewed and tested September 30, 2026.