JSON ↔ YAML Converter

Convert JSON to YAML and YAML to JSON in your browser. Preserves order, handles nested data, and flags syntax errors.

Runs in your browser — nothing uploaded
JSON input
YAML output

Use this free JSON ↔ YAML converter to translate between the two formats instantly. It preserves key order, handles deeply nested structures, and surfaces syntax errors with location information so you can fix them quickly. Runs entirely in your browser.

Private by design — your data never leaves your device

How to use it

No account, no upload — it all happens on your device.

1
Pick JSON → YAML or YAML → JSON at the top.
2
Paste your input on the left. The converted output appears on the right.
3
Use Swap to convert the output back the other way. Copy with one click.

Type mapping between JSON and YAML

The two formats overlap heavily, but a few details matter.

JSONYAML
nullnull (or empty value)
true / falsetrue / false
4242
3.143.14
"hello"hello (unquoted) or "hello"
"42""42" (quote forces string)
[1, 2, 3]- 1 - 2 - 3
{"a": 1, "b": 2}a: 1 b: 2
{"path": "/foo bar"}path: "/foo bar"

When YAML beats JSON

And when it doesn't.

  • Hand-edited config.YAML's lack of quotes and brackets makes long config files easier to read and diff.
  • Multi-line strings. YAML's | and > scalars beat JSON's escaped \n chains for embedded scripts or prose.
  • Comments.YAML has them; JSON doesn't. Useful for documenting config values.

JSON wins when machines are the primary readers — APIs, RPC payloads, anything where parser availability matters more than human ergonomics. JSON parsers ship with every language. YAML parsers are common but not universal.

YAML quirks worth knowing

  • The Norway problem (YAML 1.1): NO, YES, OFF, and ONused to be parsed as booleans. YAML 1.2 stopped that — this tool follows 1.2 — but tooling that still reads as 1.1 will silently miscast the country code "NO" as false.
  • Indentation matters. Tabs are forbidden inside indentation; use spaces only. Mixing two- and four-space indents in the same document is also a parse error.
  • Anchors and aliases (&name, *name) work on read but get materialized as duplicate data when converting to JSON — JSON has no shared-reference notation.

Frequently asked

Which YAML version is supported?
The converter uses YAML 1.2, the modern spec. It supports anchors and aliases on read, preserves key order, and handles strings, numbers, booleans, null, sequences (arrays), and mappings (objects).
How are types inferred when converting YAML to JSON?
YAML 1.2 type inference. Numbers stay numbers, true/false stay booleans, null stays null, dates are converted to ISO 8601 strings. Quoted scalars are always strings. If you want a number kept as a string, quote it in your YAML.
Does my data leave the page?
No. Parsing and serialization run entirely in your browser. Your data is never uploaded.

Related tools

Color ConverterConvert any color between HEX, RGB, HSL, HWB, and OKLCH instantly. Includes a live swatch and one-click copy for each format.QR Code GeneratorGenerate QR codes for URLs, text, Wi-Fi, and more — entirely in your browser. Download as PNG or SVG. No tracking, no uploads.Unix Timestamp ConverterConvert Unix timestamps to human-readable dates and back. Supports seconds and milliseconds, UTC and local time. All in your browser.