CSV to JSON
Convert CSV rows to a JSON array.
- 1Upload
- 2Settings
- 3Download
How to use CSV to JSON
About CSV to JSON
CSV is the plain-text format that spreadsheets and databases export; JSON is the format web applications and APIs expect. Converting turns each row into an object whose keys come from the header row, producing a list your code can read directly.
Details matter with CSV. A field containing a comma, quote or line break must be wrapped in double quotes, and a quote inside a field is doubled. Some regions export with semicolons instead of commas. Numbers and booleans arrive as text, so check whether your application needs them converted, and keep identifiers such as postcodes or phone numbers as text so leading zeros are not lost.
How it works: the tool reads your CSV, uses the first row as field names, and turns each following row into a JSON object, producing an array you can paste into code, an API test or a configuration file. Quoted fields, commas inside quotes and line breaks inside cells are handled according to the CSV rules.
Step by step: 1) add the CSV file; 2) confirm the delimiter if it is a semicolon or tab file; 3) convert; 4) copy or download the JSON. Open the result and check that numbers, empty cells and dates look the way your application expects.
Realistic limits: CSV has no data types, so every value starts out as text. A leading zero in a postcode or phone number is meaningful, so look at the output before assuming numbers were converted for you. Duplicate or empty column names can make keys collide or become blank, so clean your header row first. Huge files are limited by browser memory.
Typical uses: seeding a database or mock API from a spreadsheet export, preparing sample data for a front-end prototype, or moving a product list into a JSON-based tool.
Checking the result: JSON is strict, so a stray character in a header can become an awkward key such as one with a leading space or a byte-order mark. If your first key looks odd, re-export the CSV as UTF-8 and try again. Look at empty cells too: depending on your application, an empty string and a missing value mean different things, and you may need to post-process them.
Choosing a shape: an array of objects is the most flexible form, easy to loop over in JavaScript, Python and most databases. If you need a different structure, such as an object keyed by ID, convert first and then reshape in your code. For large datasets, test the import with the first few records, then run the full file.
Tips for better results
- Make sure the first row contains clear, unique column names.
- Save spreadsheets as UTF-8 CSV so accented characters survive.
- Open the JSON output in a formatter to check structure before importing it.
- The reverse direction is available as JSON to CSV.
- Give every column a unique, simple header; avoid spaces and punctuation if the JSON feeds code.
- Use CSV Clean first if the file has blank rows or stray spaces.
- Validate the result in your own application before importing large data.