/

JSON ⇄ YAML Converter

Processed Client Side

Convert between JSON and YAML in either direction, entirely in your browser.

JSON · 10 lines
10 lines · 173 chars
Length: 173Lines: 10Size: 173 BytesCursor: 1:1
YAML
YAML
yamlLength: 129Lines: 11Size: 129 BytesCursor: 1:1

Bookmark this tool now — skip the search next time you need it.

About JSON ⇄ YAML Converter

This tool runs entirely in your browser. Whatever you paste is processed on your own device and is never uploaded, logged, or sent to any server.

Convert JSON to YAML and YAML back to JSON in either direction, swapping between the two with one click. The two formats carry the same data model, which is why the conversion is lossless in practice — JSON is what APIs speak, YAML is what configuration files and CI pipelines speak, and moving between them is a routine chore. Converting an API response into YAML makes it dramatically easier to read and to comment on; converting a YAML config into JSON makes it something a program can consume without a parser dependency. Both directions report parse errors clearly rather than producing quietly wrong output. The YAML side is emitted with two-space indentation and no line wrapping, so long strings and URLs stay on one line instead of being folded across several — which is what keeps the result diff-friendly and safe to paste into a manifest.

Key features

  • Both directions in one tool, with a swap button that flips the conversion and moves the output back into the input
  • Full YAML support via a standards-compliant parser — anchors, multi-line strings, and nested structures
  • Parse errors reported clearly for either format, with the underlying message
  • Syntax-highlighted panes with distinct colouring for JSON and for YAML
  • Handles deeply nested documents and long lists
  • Two-space indentation and unwrapped lines on output, matching the convention Kubernetes, Docker Compose, and most CI systems use
  • Repeated structures written out in full rather than as anchors and aliases, so the output stays readable to anyone who has not met YAML references
  • One-click copy of whichever direction you converted
  • Runs entirely in your browser — Kubernetes manifests and CI configs are never uploaded

How to use it

  1. Choose the direction, or start pasting into whichever side you have.
  2. Paste your JSON or YAML into the input pane.
  3. Click Convert.
  4. Use Swap to flip the direction, or copy the result.

Tips & common mistakes

  • YAML is a superset of JSON, so any valid JSON is already valid YAML. The conversion to YAML is really a reformatting into the readable block style.
  • Indentation is structural in YAML and must be spaces — tabs are a syntax error. This is the single most common YAML mistake.
  • Beware the Norway problem: in older YAML versions, unquoted no, yes, on, and off parse as booleans, so a country code of NO can become false. Quote strings that could be misread.
  • A YAML value beginning with a special character — a colon, a hash, an at sign, a brace — needs quoting or the parser will misread it.
  • YAML supports comments and JSON does not, so converting YAML to JSON silently discards every comment. Keep the YAML as your source of truth if the comments matter.
  • For a config that will be both hand-edited and machine-read, keep YAML in the repository and convert to JSON at build time rather than maintaining both.
  • Anchors and aliases in your input are resolved on the way in and written out in full on the way back, so a YAML file that used references to avoid repetition will come back longer than it went in. That is a readability trade, not a data change.
  • A JSON document converted to YAML and straight back will match. Going the other way is where a file can change shape, because comments, anchors, and the choice of quoting style are all things YAML carries and JSON has nowhere to put.
  • Working with a Rust or Python config in TOML instead? Convert it first with TOML to JSON.

Related tools

Browse all 24 JSON tools

Frequently asked questions

9

Paste JSON or YAML into the input pane and the converted result appears instantly. Use the swap button to reverse the direction; it feeds the current output back in as the new input.

Data structures and values round-trip faithfully. YAML-only features such as comments and anchors are dropped when converting to JSON, since JSON has no equivalent for them.

YAML is whitespace-sensitive. Make sure you indent with spaces (never tabs) and keep indentation consistent within each block.

No. Both JSON and YAML conversion happen locally in your browser, so nothing you paste is uploaded.

Indentation is structural in YAML and must use spaces — tabs are a syntax error. This is by far the most common YAML mistake.

In older YAML versions, unquoted no, yes, on, and off parse as booleans, so a country code of NO becomes false. Quote any string that could be misread as a boolean.

No. JSON has no comment syntax, so every comment is silently discarded. Keep the YAML as your source of truth whenever the comments matter.

Yes — YAML is a superset of JSON. Converting JSON to YAML is really a reformatting into the readable block style rather than a change of data model.

Better to keep YAML as the source, since it supports comments and is easier to hand-edit, and convert to JSON at build time rather than maintaining two copies that can drift.