Convert CSV to JSON
Drop a CSV (or paste it) below and download JSON. Each row becomes an object keyed by the header names. Switch on nesting to turn columns like address.city into nested objects, or pick JSON Lines to get one object per line for streaming and bulk imports.
Your file
Stays on your device. Nothing is uploaded.
Drop a file hereChoose a file to convert
CSV, Excel, ODS, JSON, XML, YAML, HTML or Markdown tables. It stays on this device.
Reading messy CSV correctly
CSV looks simple until a field contains a comma, a quote or a line break. Fileshape uses a full CSV parser, so a description like "Linen, relaxed fit" stays one value and multi-line addresses stay in one field. The delimiter is detected automatically, which matters for files from European Excel installations that use semicolons; you can override it in step 1. Empty lines are skipped, and duplicate or blank headers are made unique (Name, Name (2), Column 3) so no key in the JSON is silently overwritten.
Shaping the JSON
By default you get a pretty-printed array of flat objects: [{"id": "1", "name": "Priya"}]. Many APIs expect nested structures instead. Name your columns with dots (customer.name, customer.email, shipping.city), switch on Nest dot.keys into objects and the output becomes {"customer": {"name": …, "email": …}, "shipping": {"city": …}}. The mapping step lets you rename columns to the exact keys an API wants without touching the source file, for example renaming “E-mail” to customer.email.
JSON Lines writes one compact object per line. It's the format most bulk APIs, data warehouses and log tools prefer, because it can be read and written as a stream without loading a single huge array.
Strings, numbers and empty values
Every value is written as a string. That's deliberate: CSV has no types, and guessing breaks real data. 00501 is a postal code, not 501, and 1E5 might be a product code. Empty cells become empty strings. If the consumer needs real numbers or booleans, add a formula for those columns (for example num({price})) or convert types in the receiving system, where the schema is known.
FAQ
Questions
Is my CSV uploaded anywhere?
No. Conversion runs locally in your browser.
Can I convert to YAML or XML instead?
Yes. Choose YAML or XML as the output format; XML lets you set the root and row element names.
How do I get the JSON into my code?
Use Copy in step 4 to copy the JSON straight to the clipboard, or download the file.
Related
Other conversions
- Convert Excel to CSV without breaking your dataConvert an Excel workbook to clean CSV in your browser: pick the sheet, skip title rows, keep leading zeros and choose comma or semicolon delimiters.
- Convert JSON to CSV, including nested JSONConvert JSON or JSON Lines to CSV in the browser. Nested objects become dot-named columns, arrays are joined, and the record list is found automatically.
Updated 2026-11-20