Skip to content

JSON to YAML Converter

Convert JSON to YAML and YAML to JSON in your browser. Nothing you paste is sent anywhere. Handles nested maps, sequences and quoting.

Runs entirely in your browser. Nothing you paste here is sent to us or anyone else โ€” there is no server processing, no logging of input, and no third-party scripts on this page.

This tool converts JSON to YAML and YAML back to JSON entirely in your browser โ€” nested objects and arrays, strings, numbers, booleans and null all map across correctly, with strings quoted only when needed. Paste on the left, pick a direction, and the result appears on the right to copy or download. Nothing you paste is transmitted anywhere.

JSON and YAML: two views of the same data

JSON (JavaScript Object Notation) and YAML (YAML Ain’t Markup Language) describe the same underlying shapes โ€” maps of key/value pairs, ordered sequences, and scalar values. JSON uses braces, brackets and quotes; YAML uses indentation and is designed to be easy for humans to read and edit. Because they share a data model, most documents convert cleanly in both directions. JSON is the lingua franca of web APIs, while YAML dominates configuration: CI pipelines, Kubernetes manifests, Docker Compose files and application settings.

A worked example

This compact JSON:

{"name":"QuikConsole","tags":["json","yaml"],"server":{"host":"localhost","port":8080}}

becomes this readable YAML:

name: QuikConsole
tags:
  - json
  - yaml
server:
  host: localhost
  port: 8080

Switch the mode and the same YAML converts straight back to formatted JSON. Values and their types are preserved: 8080 stays a number, true stays a boolean, and a quoted "123" stays a string.

How scalars and quoting are handled

Type mapping is the part most naive converters get wrong. When emitting YAML, a string that looks like a number, a boolean, a null, or a reserved word is automatically quoted so it survives a round-trip. So the JSON string "true" is written as 'true' rather than the bare word true, which YAML would otherwise read as a boolean. Strings with leading or trailing spaces, colons followed by a space, leading indicator characters, or the # comment sequence are quoted for the same reason. Everything else stays unquoted for readability.

What is supported, and what is not

Being honest about scope matters more than pretending to handle everything. The parser covers the common YAML subset:

Supported Out of scope (reported, not mangled)
Nested block maps and sequences Anchors and aliases (& and *)
Flow collections: [1, 2] and {a: 1} Explicit type tags (!!str, !!int)
Single- and double-quoted scalars Merge keys (<<)
Comments and a single — marker Multi-document streams (many —)
Literal | and folded > block scalars Non-string mapping keys

If the input uses an unsupported feature, the tool stops and names it โ€” for example “YAML anchors (&name) are not supported” โ€” instead of quietly producing wrong output. That way you always know whether the result can be trusted.

Common pitfalls

  • Tabs for indentation โ€” YAML forbids them. The tool converts leading tabs to spaces to be forgiving, but spaces are safest.
  • Unquoted special values โ€” color: #fff is read as a comment and an empty value; write color: "#fff".
  • Ambiguous strings โ€” words like yes, no, on and off are treated as booleans in many YAML tools; quote them if you mean the literal text.
  • Trailing commas โ€” valid in neither JSON nor YAML flow collections; remove them.

Is it safe to paste sensitive data here?

Yes โ€” this converter never sends your input anywhere. Both the YAML emitter and the parser are plain JavaScript running on your device, with no server round-trip and no third-party code on the page. For the most sensitive configuration you can load the page once and then work offline, or read the source to verify the behaviour yourself.

Frequently asked questions

Is my data sent to a server?

No. The conversion runs entirely in your browser with a self-contained parser and emitter โ€” no libraries, no network requests. You can disconnect from the internet and it still works, so nothing you paste is uploaded, logged, or stored.

What YAML features are supported?

The common subset: nested block maps and sequences, flow collections like [1, 2] and {a: 1}, single- and double-quoted scalars, plain strings, integers, floats, booleans, null and ~, comments starting with #, a single leading --- document marker, and literal (|) and folded (>) block scalars with basic chomping.

What is deliberately not supported?

Anchors and aliases (& and *), explicit type tags (!!str and friends), merge keys (<<), and multi-document streams with more than one --- separator. Rather than silently mangle these, the tool stops and tells you exactly what it found so you can handle it another way.

Why did my color value #fff become null?

In YAML a # preceded by a space starts a comment, so <code>color: #fff</code> reads as an empty value. That is correct YAML behaviour, not a bug. Quote it as <code>color: "#fff"</code> to keep the string.

Does converting change my data?

No. Values, types and order are preserved. JSON to YAML only changes the presentation; YAML to JSON produces the exact same values your YAML described. The tool quotes strings only when needed to stay unambiguous.

Why are some strings quoted in the YAML output?

Strings that would otherwise be read as a number, boolean, null, or a special YAML token get quoted so they round-trip as strings. For example the string "123" is emitted as <code>'123'</code> so it does not turn into the number 123 when parsed back.

Can I convert YAML back to JSON and get pretty output?

Yes. Switch the mode to YAML to JSON and the output is pretty-printed JSON with two-space indentation, ready to copy or download.

Does it handle tabs for indentation?

YAML forbids tabs for indentation. To be forgiving the tool converts each leading tab to two spaces before parsing, but the cleanest input uses spaces throughout.