JSON to YAML Converter

Convert JSON into clean, indented YAML in your browser. YAML 1.2 is a superset of JSON, so the result is valid — just watch unquoted values.

Document Tools Free No upload Instant

Loading JSON to YAML Converter…

Your browser is preparing the tool. It runs 100% locally.

Quick Answer

Paste JSON and get YAML. The tool reformats your data into YAML's indented style — objects become key: value lines, arrays become dash-prefixed items, two spaces per level. Since YAML 1.2 is a superset of JSON the output is valid YAML. One caution: values are written unquoted, so a string like no or 1.0 can be read back as a boolean or number. It runs in your browser.

What the JSON to YAML Converter Does

This rewrites JSON as YAML. Each object key becomes a key: value line, each array item becomes a line starting with a dash, and nesting is shown with two-space indentation. The data is unchanged — only the notation differs.

Because YAML 1.2 is a superset of JSON, valid JSON always converts to valid YAML. The catch is type safety: values come out without quotes, so anything that looks like a boolean, number or null can be re-interpreted by a YAML reader.

How It Works

Paste or type JSON. It is parsed first, so invalid JSON is reported rather than mis-converted.

The tool walks the structure: objects become key-value lines, arrays become dash items, and each level of nesting adds two spaces.

Values are written as-is, without quotes. Copy the YAML or download it as a .yaml file — entirely in your browser.

Data source & conversion logic

  1. Parse the JSON. The input is parsed so a typo is caught before conversion.
  2. Walk the structure. Objects, arrays and values are visited in order.
  3. Emit YAML lines. Keys become key-value lines, array items get a leading dash, and nesting adds two spaces.
  4. Output the YAML. The text is ready to copy or download as a .yaml file.

How JSON maps to YAML

Object key = key: value (one line per key) Array item = a line starting with a dash and a space Nesting = two spaces deeper per level Values = written unquoted
Worked example
The JSON {"name": "Smart Free Tools", "tools": ["pdf", "image"], "meta": {"free": true}} becomes (line by line): name: Smart Free Tools / tools: / then two dash items, pdf and image / meta: / then free: true.

YAML 1.2 is a superset of JSON, so the result is valid YAML — but because values are unquoted, a string like no, yes or 1.0 can be read back as a boolean or number.

Privacy

Your JSON is parsed and converted entirely in your browser — there is no server and nothing is uploaded.

The data never leaves your device, so even sensitive records stay private.

No account, no stored copy; the conversion is gone when you close the tab.

Technical Details

InputJSON
OutputYAML (.yaml)
IndentTwo spaces per level
ArraysDash-prefixed items
QuotingValues unquoted
ValidityValid YAML 1.2
Processing100% in-browser

Standards & references

  • YAML 1.2 (JSON superset) — Every valid JSON document is valid YAML 1.2, so the conversion always yields valid YAML.
  • Implicit typing (the Norway problem) — Unquoted values like no, yes, on and off can be read as booleans by YAML 1.1 parsers; quote them if type matters.
  • JSON (RFC 8259) — Input is parsed as standard JSON before conversion.

Accuracy & Limitations

Values are written unquoted. A JSON string such as no, yes, on, off, null or 1.0 comes out bare, and a YAML reader may interpret it as a boolean, null or number. This is the well-known Norway problem — quote such values yourself if a clean round-trip matters.

YAML 1.2 is a superset of JSON, so the output is valid YAML. Most JSON converts predictably; the risk is about how a value is later read, not whether the YAML parses.

This is a basic serializer. It does not add quotes, fold long strings into literal blocks, or specially handle a value that contains a colon-and-space or starts with a dash or a brace — any of which could confuse a YAML reader.

Indentation is two spaces per level. Numbers and booleans are emitted as-is, matching their JSON form.

Invalid JSON is reported as an error, so you will not get half-formed YAML from a typo.

Real-World Use Cases

Write a config

Turn a JSON config into the YAML many tools — CI, Kubernetes, Docker Compose — prefer.

Readable data

Convert dense JSON into YAML that is easier to scan and edit by hand.

Docs and examples

Show the same data in YAML for documentation or a tutorial.

Seed a pipeline

Generate a starter YAML file from a JSON source.

When to use it — and when not to

Good for

  • Reformatting JSON into readable YAML
  • Seeding config files for CI, Docker or Kubernetes
  • Hand-editing data that is nicer in YAML

Not the best choice for

  • String values like no, yes or 1.0 that must stay strings without you quoting them
  • Very long or multiline string values
  • Guaranteed lossless round-trips without review

If exact type round-trips matter, quote ambiguous values or use a full YAML library. To convert YAML back, use the YAML to JSON converter.

Frequently Asked Questions

Is the YAML valid?
Yes. YAML 1.2 is a superset of JSON, so any valid JSON converts to valid YAML. The output will parse in a YAML reader.
What is the Norway problem?
It is YAML's habit of reading unquoted words like no, yes, on and off as booleans. A JSON string of no, emitted here without quotes, can be read back as false. Quote such values to keep them strings.
Are string values quoted?
No. Values are written unquoted. For most strings that is fine, but quote anything that looks like a boolean, number or null if you need it to stay a string.
How is nesting shown?
With two-space indentation per level, the conventional YAML style.
How are arrays written?
Each item goes on its own line starting with a dash and a space, beneath its key.
Does it handle multiline strings?
There is no literal-block folding, so a long string stays on one line rather than being split into a block scalar.
Are numbers and booleans preserved?
Yes. They are emitted as-is, matching the JSON, so true stays true and 42 stays 42.
What if my JSON is invalid?
You get a clear error instead of broken YAML, because the JSON is parsed before conversion.
Can it convert YAML back to JSON?
Use the YAML to JSON converter — but note it reads only flat top-level pairs, so a full round-trip of nested data is not guaranteed.
Which YAML version does it target?
The output is plain YAML compatible with 1.2, which is a strict superset of JSON.
Is my data uploaded?
No. The conversion runs entirely in your browser, so your data stays on your device.
Why might a round-trip change a value?
Because an unquoted value can be re-typed when read — the Norway problem. Quoting ambiguous values before they are read prevents it.

References

Reformats your parsed JSON into YAML's indented style: objects become key-value lines, arrays become dash-prefixed items, two spaces per level. Because YAML 1.2 is a superset of JSON the result is valid YAML, but values are written unquoted — so a string that looks like a boolean or number can change type when re-read. Runs in your browser.

Popular

CSV to JSON Converter

CSV to JSON Converter online: fast, private and free for everyday document work.

DocumentOpen Tool
Popular

JSON to CSV Converter

Convert with JSON to CSV Converter, preserving structure and data, with zero uploads.

DocumentOpen Tool
Trending

Markdown to HTML

Markdown to HTML in seconds — accurate, free and processed locally in your browser.

DocumentOpen Tool

CSV to Excel Converter

Convert with CSV to Excel Converter, preserving structure and data, with zero uploads.

DocumentOpen Tool

Excel to CSV Converter

Excel to CSV Converter online: fast, private and free for everyday document work.

DocumentOpen Tool

Excel to JSON Converter

Convert with Excel to JSON Converter, preserving structure and data, with zero uploads.

DocumentOpen Tool

Ready to try the JSON to YAML Converter?

It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.