BrowserTools

JSON to YAML Converter

Two-way JSON and YAML conversion

By Guga — BrowserTools maintainer, Tbilisi, Georgia Updated 2026-09-01
Free Private No uploads
What is JSON to YAML Converter?

JSON is a subset of YAML, so the conversion in the forward direction is a formatting change rather than a translation — same keys, same values, different syntax. The output is indented two spaces, wrapped near a hundred characters, and written without anchors, which means a value that appears twice is written out twice instead of being aliased. Going the other way is where the interesting behaviour lives, because YAML has types JSON does not. Under the specification this parser follows, yes, no, on and off are plain strings rather than booleans, and a date such as 2026-01-01 comes back as text rather than a date object. That is the correct conservative reading, and it is why a value that looked like a boolean in one file may not be one here. Errors from either direction appear in a panel beneath the input.

Convert JSON documents to clean, readable YAML and back again with proper type preservation. Perfect for Kubernetes configs, CI pipelines and config file migrations.

Private JSON to YAML Converter In Your Browser

JSON to YAML Converter is processed locally with client-side JavaScript. Your files never touch a server, and there is no queue to wait in.

Step-by-Step

How to use JSON to YAML Converter

1

Choose the JSON → YAML tab and paste a JSON document into the input box.

2

Read the generated YAML in the output panel and copy it.

3

Switch to YAML → JSON, supply YAML, and receive two-space-indented JSON.

4

Read any parse failure in the red panel, which carries the underlying parser's message.

Key Capabilities
  • Two-space YAML indentation with lines wrapped near 100 characters
  • Shared values written out in full rather than as YAML anchors and aliases
  • YAML loaded with the conservative core types, so yes and 2026-01-01 stay strings
  • Error panel carrying the parser's own message for either direction
Common Use Cases
  • A platform engineer converting a Kubernetes manifest to YAML for a deployment repository.
  • A developer rewriting a CI configuration into YAML to match a pipeline template.
  • Someone comparing a hand-edited YAML file against the JSON a service expects.
Clear Answers

Frequently Asked Questions

Why did my YAML boolean come back as a quoted string?
Because the parser follows the current specification, where only true and false are booleans. The words yes, no, on and off are ordinary strings, and a quoted value stays a string whatever it looks like. Older tooling read them as booleans, so a file written for that tooling may change meaning. This is the safer of the two readings.
What happened to my YAML anchors?
They load correctly, and a document using &name and *name will decode to the same value in each place. Going the other way, the writer does not create them: a value repeated in your JSON is simply written out each time it appears, because an alias is harder for a human reading the file later.
Can it handle a multi-document YAML file?
Not in one go. A file with --- separators contains more than one document, and the parser expects a single one, so it reports that it found more than one and stops. Split the file at the separators and convert each section separately, or use a tool built for streams.
Are types preserved through the round trip?
Strings, numbers, booleans, null, arrays and objects all survive. The things that do not survive are YAML-only types: a bare date is read as text, a sexagesimal value like 12:30 is read as a string, and a tagged or custom type has no JSON equivalent at all. Values that were already JSON types come back unchanged.

Related Guides

View all guides →