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
The code 001 is an identifier, not a quantity.
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.
- 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
JSON input is UTF-8 only. CSV output also requires an encoding and delimiter choice.
- Open Character encoding and format conversion, then choose a CSV or JSON file.
- For CSV, verify the input encoding, delimiter, and headers.
- Choose JSON or a CSV format as the output.
- Review the value types chosen automatically for CSV-to-JSON, or the columns and values inside objects for JSON-to-CSV.
- Verify item counts and download. Confirm the formula-risk warning for CSV output when shown.
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