JSON & YAML

YAML ⇄ JSON

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.

Convert locally

Runs locally in your browser. Your YAML and JSON are not uploaded, saved, or shared.
0 characters
JSON
The converted result will appear here.

Paste YAML or JSON to convert it.

Ready when you are.

Watch: convert YAML and JSON

No sound. Each step is captioned on screen and also written out in the guide below.

Convert in three steps

  1. 01
    Choose a direction

    YAML to JSON, or JSON to YAML.

  2. 02
    Paste or drop a file

    It converts as you type, and flags anything that needs fixing first.

  3. 03
    Copy or download

    Or use the result as input to convert it back.

What it keeps exact

  • Big numbers: IDs too large for JavaScript keep every digit.
  • Anchors and aliases: expanded into plain JSON (with a limit, for safety).
  • Several documents: become a JSON array.
  • Tricky text: "no", "on", and "0755" are quoted in YAML, so every tool reads them as text.

Frequently asked questions

What happens to YAML comments in JSON?

JSON has no comments, so they're left out. Converting back gives the same data, without the comments.

Is YAML cheaper than JSON for AI prompts?

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.

Why are some strings quoted in the YAML?

Values like no, on, and 0755 mean true, false, or an octal number to some YAML tools. Quoting them keeps them as text everywhere.

Is my data uploaded?

No. Converting and counting tokens both run in your browser.