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. Watch for 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. All of it happens 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. All of this happens 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. Because values are unquoted, though, a string like no, yes or 1.0 can be read back as a boolean or number.

Privacy

Your browser parses and converts the JSON without a server, and the tool uploads nothing.

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

You don't need an account and the site keeps no copy, so the conversion is gone once 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 and limits

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 these 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.

Where people use it

Write a config

Turn a JSON config into the YAML that many tools, such as CI systems, Kubernetes and 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 it fits, and when it doesn't

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 that 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. Your browser does the conversion, 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. This is 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. All of it happens in your browser.

Popular

CSV to JSON Converter

CSV rows become a JSON array, keyed by the header row.

DocumentOpen
Popular

JSON to CSV Converter

Flatten a JSON array of objects into CSV columns.

DocumentOpen
Trending

Markdown to HTML

Turn everyday Markdown into clean HTML in your browser.

DocumentOpen

CSV to Excel Converter

Pasted CSV becomes a real .xlsx, with leading zeros kept.

DocumentOpen

Excel to CSV Converter

Pull the first sheet of a workbook out as plain CSV.

DocumentOpen

Excel to JSON Converter

Each spreadsheet row becomes a JSON object keyed by the header.

DocumentOpen

Back to the JSON to YAML Converter

The file never leaves your computer, and you don't need an account.