Watch: convert YAML and JSON
No sound. Each step is captioned on screen and also written out in the guide below.
JSON & YAML
Convert YAML to JSON or JSON to YAML, with the same data either way. Values that YAML tools read differently are quoted, and token counts show what each format costs an AI model.
The converted result will appear here.
Paste YAML or JSON to convert it.
| Format | o200k_base GPT-5, GPT-4.1, GPT-4o | cl100k_base GPT-4, GPT-3.5 | Difference |
|---|
Exact counts with OpenAI's tokenizers. For Claude and Gemini estimates, use the AI Token Counter.
No sound. Each step is captioned on screen and also written out in the guide below.
YAML to JSON, or JSON to YAML.
It converts as you type, and flags anything that needs fixing first.
Or use the result as input to convert it back.
"no", "on", and "0755" are quoted in YAML, so every tool reads them as text.JSON has no comments, so they're left out. Converting back gives the same data, without the comments.
Cheaper than formatted JSON, but usually not cheaper than minified JSON. In our tests YAML used about 30–40% fewer tokens than indented JSON, but about 20% more than the same JSON on one line. The table shows all three for your data. For lists of records, a table is cheapest: see JSON to LLM Table.
Values like no, on, and 0755 mean true, false, or an octal number to some YAML tools. Quoting them keeps them as text everywhere.
No. Converting and counting tokens both run in your browser.