How to use
- Paste your CSV or JSON into the box. Use Load example to try a small CSV file.
- Press CSV to JSON or JSON to CSV. Choose the delimiter if it is not a comma, and tick the options you need: first row is the header, convert numbers and true/false.
- Copy the result, or press Use result as input to convert it back and check the round trip.
Examples
name,age,note Ada,36,"likes, commas" Alan,41,"two lines"
→ [
{ "name": "Ada", "age": "36", "note": "likes, commas" },
{ "name": "Alan", "age": "41", "note": "two\nlines" }
]Quoted fields can contain commas and line breaks. The output is shown shortened here; the tool writes standard indented JSON.[{"a":1},{"b":2}]→ a,b 1, ,2JSON to CSV. Objects with different keys still line up, because every key that appears becomes a column.
a,b with the option "convert numbers and true/false", row: 1,true
→ [{"a": 1, "b": true}]Without the option the values stay text: "1" and "true".How it works
CSV is read by the open-source Papa Parse library, which understands quoted fields, line breaks inside fields and several delimiters. With the header option on, the first row gives the keys and each later row becomes an object. Without it, each row becomes a list.
Rows that have more or fewer fields than the header are still converted, and the first few such rows are listed as warnings so you can check them. A quote that is never closed stops the conversion, because the rest of the text cannot be read reliably.
For JSON to CSV, the columns are every key that appears in any object, in the order they first appear. Missing values become empty cells. The output uses plain line feeds between rows.
Sources
- RFC 4180: Common Format and MIME Type for CSV Files
- Papa Parse, the open-source library used here
- OWASP: CSV Injection
Frequently asked questions
- How are commas and line breaks inside a field handled?
- A field that contains the delimiter, a quote or a line break is wrapped in double quotes, and a double quote inside it is written twice. This is the rule in RFC 4180, and the tool follows it when reading and when writing.
- Why are my numbers text in the JSON?
- CSV has no types, so every value is read as text unless you ask otherwise. Tick Convert numbers and true/false to get JSON numbers and booleans. Leave it off when values such as zip codes or IDs with leading zeros must stay exactly as written.
- My file uses semicolons. Will it work?
- Yes. The delimiter is detected automatically, but a short file can be too little to go on, so choose Semicolon (;) yourself if the result looks wrong. Spreadsheets in some regions save CSV with semicolons.
- What happens to nested JSON?
- CSV is flat, so nested objects and arrays are written as JSON text inside their cell. Convert them with another tool first if you need separate columns.
- What is the formula protection option?
- A spreadsheet may run a cell that begins with =, +, - or @ as a formula, which can be abused when the data comes from someone else. With the option on, such cells get a leading apostrophe so they are shown as text.
- Is my data uploaded?
- No. The conversion runs in your browser.