CSV and JSON conversion guide
How to convert CSV to JSON and JSON to CSV in your browser
A CSV with headers can become a list of JSON objects, while a nonempty UTF-8 list of objects can become CSV. This guide focuses on the data layout and values; use the encoding guide when the output remains CSV.
Example: create test data for a receiving system
Keep a leading-zero product code as text while converting a standard price to a JSON number.
- Input: CSV with a header
- Output: UTF-8 JSON without BOM
- Structure: list of objects
Product CSV
Read the first product as a customer would see it. Its identifier has three characters, 001. Set code to String if the receiving system requires that spelling. Leave price on Auto-detect for a numeric 12.8.
code,name,price,active
001,Notebook,12.80,true
002,Pen,2.40,falseList of JSON objects
Standard decimal values become numbers; leading-zero values and true/false text remain strings.
[
{ "code": "001", "name": "Notebook", "price": 12.8, "active": "true" },
{ "code": "002", "name": "Pen", "price": 2.4, "active": "false" }
]Common conversion mistakes
Not every valid JSON document can be arranged as rows and columns.
- One input file can be up to 500 MB. JSON repeats column names in every object, so the output can be larger. Conversion stops if the result would exceed 512 MB.
- Providing a single object or empty array
- Saving JSON in a non-UTF-8 encoding
- Missing adjusted keys for blank or duplicate CSV headers
- Assuming large integers or leading-zero IDs will be ordinary numbers
Convert CSV or JSON
For the reverse trip, save [{"code":"001","price":12.8},{"code":"002"}] as UTF-8 JSON and choose CSV. The result has two data rows. The second price is blank because the second object has no price key. A null price would produce the same cell.
- Open Convert encoding & format, then choose a CSV or JSON file.
- For CSV input, check the encoding, delimiter, and headers in the preview.
- For CSV to JSON, select JSON as the output and adjust column types as needed. With Auto-detect, the example price becomes a number and the product code keeps its leading zeros as a string.
- For JSON to CSV, check the columns and nested values in the preview, then choose the CSV output encoding and delimiter.
- Run the conversion, verify the input and output record counts, and download. Review any formula-risk warning before opening the CSV in a spreadsheet.
Format conversion versus encoding conversion
Use this tool to change the data layout. Use the Excel encoding guide to keep CSV while fixing garbled text.
- Good fit: test data as a list of JSON objects
- Good fit: JSON exports arranged as rows and columns
- Encoding only: use the encoding guide
- Splitting data with several levels into multiple tables is unsupported