JSON ↔ YAML ↔ CSV ↔ TOON Converter

Convert between JSON, YAML, CSV and TOON in any direction, with format detection, error positions, a table preview and a token comparison for LLMs.

Runs locally in your browser
→Detected: YAML

Table preview

1 row
toolssite.urlsite.languages
[{"name":"Base64","category":"encoding","clientSide":true},{"name":"QR code","category":"generators","clientSide":true}]https://no.tools["en","de"]

About this tool

YAML, JSON, CSV and TOON often describe the same data in different ways: JSON is the standard for APIs, YAML is popular for configuration (Docker Compose, Kubernetes, GitHub Actions), CSV is the table format of Excel, Google Sheets and database exports – and TOON (Token-Oriented Object Notation) is a compact format for data in AI prompts that needs far fewer tokens than JSON.

This converter works in every direction and detects the input format automatically. Errors are shown with their line number, and tabular data appears in a table preview right away. When importing CSV you can choose the delimiter – important for files from European Excel versions, which often use semicolons.

How it works

  1. Paste your data – the format is detected automatically, or choose it under “From”.
  2. Pick the target format under “To”: JSON, YAML, CSV or TOON.
  3. Adjust indentation, delimiter and header row if needed.
  4. Copy or download the result, or keep working with it via “Use output as input”.

Frequently asked questions

Which JSON structure can be converted to CSV?

CSV is a table. A list of objects works best, e.g. [{"name":"Anna","age":30}, …]. The keys become column headers. Nested objects become columns with a dot path (e.g. address.city), arrays are written into the cell as JSON text. Converting back restores the nested structure.

Why does my Excel CSV end up in a single column?

Some Excel versions save CSV with semicolons instead of commas. Set the CSV delimiter to “Auto” or “Semicolon” and the columns are detected correctly.

Are YAML comments preserved?

No. JSON and CSV have no comments, so they are lost during conversion. YAML anchors are resolved and written as regular values.

Are numbers and booleans kept?

Between YAML and JSON, data types are preserved. CSV has no types. When reading CSV, only unambiguous values are converted: numbers like 42 or 3.5, true/false and null. Values with a leading zero such as ZIP codes (02134) stay text.

What is TOON and when is it worth it?

TOON writes lists of similar objects like a table: the field names appear once in a header (users[2]{id,name}:), followed by one line per entry. That saves quotes, brackets and repeated keys – often 30–60 % of the tokens for tabular data. It is cheaper for LLM interfaces and prompts, but less familiar for humans. Convert in both directions here, and the size comparison shows how much you save.

How accurate is the token estimate?

It assumes about four characters per token, the common rule of thumb for English text and popular tokenizers. The real number depends on the model. Because JSON has many punctuation characters that become tokens of their own, the advantage of TOON is usually even larger in practice.

Can I validate and format the JSON first?

Yes, the JSON Formatter & Validator validates, formats and minifies JSON and shows errors with line and column.