Tech / JSON ⇄ CSV / YAML Converter
JSON ⇄ CSV / YAML
Convert between JSON, CSV and YAML in either direction. Nested objects become dotted column names in CSV. Nothing leaves your browser.
JSON to CSV works best with a list of objects, like [{"name":"A","age":30}, ...]. Each object becomes a row; nested objects become columns such as address.city, and lists are kept as JSON text in one cell.
JSON, CSV and YAML compared
| Format | Used for | Good to know |
|---|---|---|
| JSON | Web APIs and apps | Handles nested data and lists |
| CSV | Spreadsheets such as Excel and Google Sheets | Flat rows and columns only |
| YAML | Configuration files, such as Docker Compose, Kubernetes and GitHub Actions | Easy to read, but the indentation matters |
How nested data becomes CSV
CSV has no nesting, so this page flattens nested objects into dotted column names. This JSON:
[{"name":"Anu","address":{"city":"Brisbane","postcode":"4000"},"skills":["nursing","IELTS"]}]
becomes the columns name, address.city, address.postcode and skills. The list of skills is kept as JSON text in one cell, so no data is lost.
Opening a CSV in Excel
Excel can change some values when it opens a CSV: it drops the leading zero from phone numbers such as 0412 345 678, and shows long ID numbers in scientific notation. To keep them exactly, import the file with Excel's data import and set those columns to Text. If your Excel expects semicolons, choose the semicolon separator above.
Common YAML mistakes
- Indent with spaces, never tabs.
- Put quotes around values that could be misread, such as
"yes","no","08"or a postcode with a leading zero.
Your data is converted in your browser and is not uploaded.