CSV to JSON
Convert csv to json using the available input and format options.
About CSV to JSON
Spreadsheet exports often need to become JSON for a mock API, a seed script, a chart library or a static site. This converter handles the common case of a small, clean CSV with a header row, such as a product list, a contact sheet or survey results you want to drop into code.
How it works
The text is split into lines, and each line is split on every comma. The first row supplies the keys. Every later row becomes an object, and missing cells become empty strings. Cells are trimmed, and one leading and one trailing double quote are removed. Quoted fields that contain commas are not supported, so they split into extra columns. Every value stays a string. A blank header gets a name like col2. Extra cells beyond the headers are dropped. The output is an indented array that can be saved as from-csv.json.
How to use CSV to JSON
- Enter the text or data in the format shown in the text box above (Paste CSV).
- Select “Run tool” and check the result before copying or downloading it.
Worked example
Input rows: name,city,age then Ana,Lahore,29 then Bo,Dubai,34. Output: an array of two objects, {"name": "Ana", "city": "Lahore", "age": "29"} and {"name": "Bo", "city": "Dubai", "age": "34"}, printed with a two-space indent. The ages are strings, because the converter does not detect types.
Tips for a better result
- Before exporting, replace commas inside cells, such as in addresses like Main St, Suite 4, with another character. The splitter cannot tell them apart from separators.
- Semicolon-separated files from European Excel settings will not split. Re-save as comma-separated, or swap the separators first.
- Remove blank lines in the middle of the file. Each one becomes an object with empty values.
Frequently asked questions
Why are my numbers in quotes?
The converter keeps every cell as text, so 29 becomes "29". This avoids damaging values like ZIP codes with leading zeros. Convert numeric columns in your own code if needed.
Can it handle quoted fields with commas or line breaks?
No. It splits on every comma and every line break, regardless of quotes. A cell like "Smith, John" becomes two columns. Use a full CSV parser for files that rely on quoting.
Is there a row limit?
No limit is coded, and everything runs in your browser's memory. Very large files of many megabytes may make the page slow, so split huge exports into smaller pieces.
What to check
A formatted or parsed result is not proof that code is secure, correct or production-ready. Never paste production secrets.
Read the Privacy Policy for information about local processing, connected services and advertising.