Skip to content
devtoolbox.cc

JSON ↔ YAML ↔ CSV Converter

Convert JSON to YAML or CSV and back. Lossless numbers, YAML 1.1-safe quoting, nested fields flattened to columns, Excel-friendly CSV.

Runs locally in your browser

About the JSON ↔ YAML ↔ CSV converter

Convert between JSON, YAML and CSV in any direction, or reformat a file in the same format (for example, to change a CSV delimiter). Conversion is live and happens entirely in your browser.

JSON and YAML

  • YAML is read with the YAML 1.2 rules, so country: no stays the string "no" instead of turning into false (the “Norway problem”).
  • When writing YAML, strings like yes, on, 010 or 2024-01-01 are quoted, so older YAML 1.1 tools (PyYAML, Go, many CI systems) read them back exactly.
  • Anchors, aliases and << merge keys (docker-compose, GitLab CI) are expanded. Multiple documents (---) become a JSON array.
  • Large integers such as 9007199254740993 and spellings such as 1.0 are kept exactly.
  • Comments and custom tags such as CloudFormation’s !Ref cannot be represented in JSON. You get a notice when they are dropped.

JSON and CSV

  • An array of objects becomes one row per object, with columns from all keys.
  • Nested fields are flattened into columns like address.city and tags.0, and rebuilt when converting back. Alternatively, keep them as JSON text in a single cell.
  • Strings that would otherwise be read back as numbers or booleans ("123", "1e3", "true") are quoted, so this converter reads them back as strings. 007 is never read as a number (leading zeros are not valid JSON numbers), so it needs no quotes.
  • Strings that look like JSON ("{}", "[1,2]") are written as JSON strings, so they come back as strings, not as objects or arrays. A notice tells you when this happened.
  • An empty field means null; "" means an empty string. A key missing from some objects also becomes null on the way back: CSV has no way to say “absent”.
  • Quoting only guides this converter and other CSV readers. Spreadsheets apply their own rules and may still show "007" as 7; import the column as text to keep leading zeros.
  • The delimiter (comma, semicolon, tab or pipe) is detected automatically when reading.
  • Use Add BOM for Excel so Excel opens UTF-8 files (Cyrillic, accents, emoji) correctly. The BOM only fixes the text encoding, not column types.
  • Turn on Escape formulas when a spreadsheet will be opened by others, to reduce the risk of CSV formula injection. Header names and values that start with =, +, -, @, tab or CR get a leading '; numbers such as -1 are left alone. The option changes those strings, so it is off by default.

Header names that themselves contain a dot are split into nested objects when reading. Turn off Unflatten to keep them as they are.