YAML ⇄ JSON Converter
Converters & FormattersConvert YAML to JSON and back, both directions in one tool — swap carries the result straight into the input. Anchors and merge keys resolve on the way in; JSON emits canonical 2-space YAML on the way out.
What it does
Converts YAML to JSON and JSON to YAML in one place. The YAML direction resolves anchors and merge keys and emits pretty 2-space JSON; the JSON direction emits canonical 2-space YAML, quoting strings that would otherwise look like numbers or booleans ("1.5" stays a string). Swap flips the direction and carries the result straight back into the input, so a round-trip is one click. Invalid input in either direction produces the parser’s error message, never partial output. Everything runs locally in your browser.
How to use it
- Paste YAML (or JSON) into the input on the left. The direction badge above the box says which side you’re on: YAML or JSON.
- The conversion appears live on the right. Copy takes it; Download saves it as
converted.jsonorconverted.yamldepending on direction. - Swap exchanges the two sides and moves the output into the input — convert back immediately.
- Copy share link encodes your input and direction in the URL.
Examples
Tap Sample (YAML direction):
deploy: {stack: edge, replicas: 3} plus a labels list → nested JSON object with the list as an array.
The K8s manifest chip converts a Service manifest — nested spec.ports array-of-maps becomes a JSON array of objects.
In the JSON direction, {"version": "1.5"} round-trips as version: '1.5' — quoted in YAML so it cannot re-parse as a float.
Good to know
- YAML anchors (
&anchor/*ref) and merge keys (<<:) are resolved on the way in; the JSON side never sees them. - A bare YAML
null(or an empty document) converts to JSONnull. - The JSON→YAML direction uses block style for maps and sequences — no inline
{}output. - Dates are left as strings on both sides; no silent date typing.