Convert JSON to YAML

Turn JSON from an API or a tool's output into YAML for a config file, a Helm values file or a CI pipeline. Strings that some YAML parsers would misread are quoted for you.

  • Free
  • Runs in your browser
  • Safe quoting
  • No sign-up
How it works

How It Works

Convert JSON in three steps.

01

Paste JSON

An object or array from anywhere.

02

Choose the style

Indent, quoting, key sorting and line wrapping.

03

Copy or download

Copy the YAML or save it as converted.yaml.

About

Writing YAML that every parser reads the same

YAML has a famous trap: older parsers (YAML 1.1, used by PyYAML and many Kubernetes tools) read unquoted yes, no, on, off and y as booleans, so a country code of NO can turn into false. This converter writes with YAML 1.1 quoting rules, so any string that could be misread, including those words, numbers with leading zeros and date-like text, is put in quotes. The result is valid for both YAML 1.1 and 1.2 parsers.

JSON has no comments, so the YAML has none either. Add them afterwards to explain settings for whoever edits the file next.

Safe quoting

"yes", "off", "012" and "2025-01-01" stay strings in every parser.

Sort keys

Optional alphabetical keys for stable, diff-friendly files.

2 or 4 spaces

Lists are indented under their key, the style most projects use.

Long strings

Keep long strings on one line, or fold them at 80 characters.

Features

Why Use This Converter

Config-ready YAML from JSON.

No boolean surprises

Ambiguous strings are quoted automatically.

Stable output

Sorted keys make reviews and diffs easier.

JSON errors located

Invalid JSON is reported with a line and column.

Private

Converted in your browser.

✓ No Registration✓ Free✓ Browser-based✓ Text Stays Local
FAQ

Frequently Asked Questions

Questions people ask about the JSON to YAML converter.

Only strings that a YAML parser could read as something else are quoted: words like yes and off, numbers with leading zeros, and text that looks like a date or number. Tick Quote all strings to quote every one.