CSV and JSON Converter
Convert CSV to JSON, or JSON back to CSV, with configurable delimiter and pretty-printing.
CSV and JSON Converter
Input
Output
Going one way, each row becomes an object keyed by the header. Going the other way, the keys become the header and any key missing from a row is left empty.
History for this tool
The most recent data you entered in this tool, stored only in this browser.
Save what you type here, in this browser? Your work would go into this browser's local storage, so a refresh or a trip to another tool does not wipe it. You also get a short list of previous entries under the form, each one restorable with a click. Nothing is ever uploaded, and there is no account.
Being straight about the trade-off: anything kept there can be read by anyone who can use this browser profile, and by any script that later runs on this site. A tool page can hold a private key, a password or a signed token. Saving is convenient; it is not private.
About this tool
Move between the two shapes that CSV and JSON use for tabular data. Going to JSON, each row becomes an object keyed by the header; going to CSV, the keys become the header and any key a row is missing is left empty. The delimiter is detected for CSV input and can be set by hand.
Questions
- What does the JSON have to look like?
- An array. Each item can be an object, whose keys become columns, or an array, which is written as a plain row. Anything that is not an array is rejected with a message rather than a partial result.
- Where does the extra header come from?
- When objects have different keys, the header is the union of all of them, in the order the keys first appear. A row that lacks one of those keys simply gets an empty cell.
- Are values converted to numbers?
- No. CSV cells are text, so 120 in a CSV file becomes the string "120" in JSON. Convert the types in your own code if the number matters.