What is this calculator?
Parses CSV text into a JSON array of objects, using the header row for keys (or generated names when there is no header). It follows the standard quoting rules, so fields containing commas, quotes, or line breaks survive intact.
Use it when:
- You exported a spreadsheet and need JSON for an API or a script.
- You want to inspect CSV content as structured data.
- Your CSV contains quoted fields with embedded commas that naive splitting would break.
Intended for: Developers and analysts moving spreadsheet data into a program.
How is this calculated?
- The text is scanned character by character rather than split on commas, so the parser can track whether it is inside a quoted field.
- Inside quotes, commas and newlines are literal content, and a doubled quote means one literal quote character.
- The first row supplies the object keys when "first row is a header" is enabled; otherwise keys are generated positionally.
- Every subsequent row becomes one object, pairing each cell with its column key.
- Values remain strings — no type inference is applied, because guessing that "0123" is a number would silently destroy identifiers and leading zeros.
Example
Parsing `name,age` / `Ada,36` with the header row enabled.
- The header row gives the keys name and age.
- The single data row is paired against them.
Result: `[{ "name": "Ada", "age": "36" }]` — 1 row, 2 columns.
Frequently asked questions
Why are numbers returned as strings?
Because type inference is lossy. A postcode of "01234" or an ID of "1e5" would be silently mangled if converted to a number. Values are preserved exactly as written; convert the fields you know are numeric yourself.
Does it handle commas and newlines inside a field?
Yes, provided the field is quoted, as the CSV convention requires. A quoted field can contain commas, line breaks, and — by doubling them — quote characters.
What if the file has no header row?
Turn off "first row is a header" and column names are generated positionally, so the first row is treated as data.
Assumptions
What this calculator takes as given:
- The transformation is performed in your browser; the text you paste is not uploaded or stored.
- Input is treated as UTF-8 text.
- Fields are comma-separated and quoted with double quotes where required.
- All values are preserved as strings.
Limitations
What this calculator cannot know or does not model:
- Alternative delimiters such as semicolons or tabs are not supported.
- No type inference: numbers, booleans, and dates all remain strings.
- Rows with more or fewer cells than the header are paired positionally, which may leave keys missing or values unassigned.
References
- RFC 4180 — Common Format and MIME Type for CSV Files — IETF. The quoting and escaping conventions this parser follows.