CSV to JSON Converter
Convert CSV data to a JSON array of objects online. Auto-detects delimiter and quotes, preserves numeric types when requested.
Last updated:
Paste CSV above to convert it into a JSON array of objects. The first row becomes the keys, and quoted fields with commas or newlines are handled per RFC 4180. Runs locally.
What is CSV → JSON?
Converting CSV to JSON transforms spreadsheet or export data into the structured array of objects that APIs, JavaScript, and NoSQL databases expect. The parser follows RFC 4180 — it correctly handles quoted fields containing commas, embedded newlines, and escaped quotes — and can optionally coerce numeric strings into real numbers.
How to convert CSV to JSON
- 1Paste your CSV (with a header row) into the input pane.
- 2The first row is used as object keys; each subsequent row becomes one JSON object.
- 3Toggle numeric type inference if you want "42" parsed as a number instead of a string.
- 4Copy the JSON array for use in code, an API request, or a database import.
Use Cases
Feed spreadsheet data to an API
Turn an exported CSV into the JSON array your endpoint expects for a bulk create/update.
Seed a database or fixture
Convert a CSV of sample rows into JSON to seed MongoDB, a test fixture, or a mock server.
Process exports in JavaScript
Get a real array of objects you can map, filter, and reduce over in Node or the browser.
Code Examples
Input CSV
id,name
1,Ada
2,LinusOutput JSON
[
{ "id": "1", "name": "Ada" },
{ "id": "2", "name": "Linus" }
]Key Concepts
- Quoted fields
- A field wrapped in double quotes can contain commas, newlines, and doubled quotes (""). This lets CSV hold free-text safely.
- Header row
- The first line names the columns. Without it, keys fall back to positional names like col1, col2.
- Type inference
- CSV is all text. Numeric inference turns "42" into 42 and "true" into a boolean — convenient, but disable it for zip codes or IDs with leading zeros.
Tips & Best Practices
- ▸Leading-zero IDs (like 00123) lose their zeros if numeric inference is on — keep them as strings.
- ▸If columns look misaligned, your CSV may use a different delimiter (semicolon/tab). Check the source export settings.
- ▸Fields with commas must be quoted in the source CSV, or the parser will split them into extra columns.
- ▸Trailing empty lines produce empty objects — trim the input if you see stray {} entries.
Frequently Asked Questions
Does the parser handle quoted fields with commas inside?
Yes. Fields enclosed in double quotes may contain commas, newlines, and escaped quotes (""), following RFC 4180.
Can I skip the header row?
By default the first row is treated as the header. You can disable this to get JSON with numeric field names (col1, col2, …) instead.
Related Tools
JSON → TypeScript
Convert JSON to TypeScript interfaces instantly. Generate strongly-typed TS types from any JSON sample.
JSON → Go
Convert JSON to Go structs online. Generates idiomatic Go structs with proper json tags and PascalCase field names.
JSON → YAML
Convert JSON to YAML online. Preserve structure, comments-free, and ready to paste into Kubernetes or CI configs.
YAML → JSON
Convert YAML documents to JSON online. Supports YAML 1.2, multi-document streams, and produces pretty-printed JSON output.
JSON → CSV
Convert an array of JSON objects to CSV online. Headers are inferred automatically from all keys across records.
Number Base
Convert numbers between binary, octal, decimal, and hexadecimal. Supports arbitrarily large integers using BigInt.