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: nostays the string"no"instead of turning intofalse(the “Norway problem”). - When writing YAML, strings like
yes,on,010or2024-01-01are 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
9007199254740993and spellings such as1.0are kept exactly. - Comments and custom tags such as CloudFormation’s
!Refcannot 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.cityandtags.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.007is 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 becomesnullon 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"as7; 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-1are 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.