⚙️ YAML ↔ JSON

Convert YAML to JSON or JSON to YAML with validation

✓ Free Forever · ✓ No Signup · ✓ No Upload · ✓ Works Offline

🔒 Your data never leaves your device. All processing happens locally in your browser using js-yaml library (client-side). No upload, no server, no tracking.

Features

  • Bidirectional Conversion — Convert YAML to JSON or JSON to YAML with one click. Several documents become a list, and a list can become several documents again.
  • Real-Time Validation — Instantly validates your input and shows clear error messages for syntax issues.
  • Copy, Download or Open a File — Copy the result, download it named after your file, or open a .yaml / .yml / .json file (or drop it on the box) — a .json file switches to JSON → YAML for you.
  • Sample Content — Load sample data to see the conversion in action.

How It Works

  1. Choose direction — Select YAML to JSON or JSON to YAML.
  2. Paste your content — Paste YAML or JSON, open a file, or drop one on the input box.
  3. Copy or download — Get the converted output — validated and formatted.

Use Cases

  • Convert Kubernetes YAML configs to JSON for API calls
  • Transform JSON config files to YAML for readability
  • Validate YAML syntax before deploying configurations

Frequently Asked Questions

Does it support complex YAML features?

Yes: anchors and aliases, merge keys (<<), multi-line strings, and files with several documents separated by --- (they become one JSON array, in order). CloudFormation’s short forms (!Ref, !Sub, !GetAtt and so on) can be written out as JSON: press “Convert CloudFormation tags” when the page finds one. Any other custom tag, such as Home Assistant’s !include, isn’t standard YAML, so the tool names it and its line instead of guessing. A list or mapping used as a key is named too, because JSON keys are text.

Is the output formatted?

Yes. JSON comes with 2 spaces, 4 spaces, tabs or on one line; YAML with 2 or 4 spaces.

Will long IDs, prices or dates change?

No. Numbers are copied digit for digit in both directions — 12345678901234567890 stays 12345678901234567890 and 1.10 stays 1.10 (a plain JavaScript conversion would give 12345678901234567000 and 1.1). A date like 2024-01-15 stays that text instead of becoming a timestamp in a time zone the file never stated. Hex and octal numbers (0x1F, 0o14) are written in decimal, since JSON only has decimal, and .inf / .nan become null with a note. One exception you’ll be told about: JSON has no leading zeros, so an unquoted 0644 becomes 644 (see the YAML 1.1 question below); quoted, it stays as it is.

What happens to repeated keys?

In YAML a key may appear only once per mapping, so a repeat is reported with its line instead of being silently dropped. JSON is looser: when a JSON object repeats a key, the last value is kept (as every JSON reader does) and the page lists the repeated keys so you can check them.

Why is no, yes or 0644 different in another tool?

Because there are two YAML versions in use. YAML 1.2, which this page follows, reads yes / no / on / off as plain text and 0644 as the number 644. YAML 1.1 readers such as PyYAML read them as true / false and as octal (420) — that’s how the country code NO turns into false. The page lists every such value it finds, and “Read like YAML 1.1” shows the other reading. Quotes around the value make it safe in both. Not every 1.1 reader follows every rule, so check what your own tool does.

Are comments kept?

No. JSON has no comments, so they are left out when YAML becomes JSON, and they can’t come back on the way to YAML. Keep your original file.

Notes from Milo 🐨

2026-11-25

I pasted a Helm template in here and got {"[object Object]": null} back, with a green “Valid” on top. That's now named for what it is, and so are the other quiet surprises: 0644 turning into 644, NO and yes meaning something else in older YAML 1.1 tools (there's a tick box to read the file their way), and lines indented with spaces copied from a web page. CloudFormation templates convert too: one click writes out !Ref, !Sub and !GetAtt. Errors show the line with a caret and say why in your language, tabs and odd spaces can be cleaned up in one click, almost-JSON gets repaired, and you can pick the indentation or turn a list back into several documents.

2026-10-05

I fed this a real config and it quietly changed it: a 20-digit tenant ID came out as a different number, price: 1.10 became 1.1, and a plain date turned into a midnight-UTC timestamp. A Kubernetes file with several documents (---) wasn't converted at all. Now numbers are copied digit for digit both ways, dates stay exactly as you wrote them, several documents become one JSON array, and anything JSON can't hold (.inf, !!binary, a CloudFormation !Ref) is named instead of silently mangled. You can also open or drop a .yaml or .json file, and switching direction carries the result over.

Related Tools

💬 Bug, idea, or just to say hi? Tell Milo 🐨 · [email protected]