Skip to main content

CSV and JSON conversion guide

How to convert CSV to JSON and JSON to CSV in your browser

Open Format conversion

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.

Published:

Updated:

Related tool: Convert encoding & format

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.

products.csv
code,name,price,active
001,Notebook,12.80,true
002,Pen,2.40,false

List of JSON objects

Standard decimal values become numbers; leading-zero values and true/false text remain strings.

products.json
[
  { "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.

  1. Open Character encoding and format conversion, then choose a CSV or JSON file.
  2. For CSV, verify the input encoding, delimiter, and headers.
  3. Choose JSON or a CSV format as the output.
  4. Review the value types chosen automatically for CSV-to-JSON, or the columns and values inside objects for JSON-to-CSV.
  5. Verify item counts and download. Confirm the formula-risk warning for CSV output when shown.
Convert encoding & format

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