JSON ↔ YAML Converter
Convert JSON to YAML or YAML to JSON — pick the indent and copy the result.
How to use
- Pick the direction — JSON → YAML or YAML → JSON.
- Paste your input. The result updates as you type.
- Change the indent (2 or 4) for the output.
- Swap uses the output as the next input.
About this tool
ShowHide
Paste JSON and get clean YAML, or paste YAML and get JSON, at your choice of two- or four-space indent. It is built on js-yaml 4, which follows the YAML 1.2 core schema — so yes and no stay strings rather than turning into booleans the way older 1.1 parsers did, while an unquoted 1.10 is still read as the number 1.1 and loses its trailing zero. Anchors and merge keys are resolved on the way in, so the JSON you get back has the shared block written out in full, and repeated structures are dumped without aliases in the other direction too. Comments are not part of the data model and do not survive a round trip. Useful for moving between Kubernetes manifests, GitHub Actions workflows, and JSON-based tooling.
Frequently asked questions
What YAML version is supported?
YAML 1.2 via js-yaml. Anchors, flow style, multi-line scalars, booleans, and null are all handled.
Does it preserve key order?
Yes. JSON's natural object order is kept when emitting YAML, and YAML mapping order is kept when emitting JSON.
What if the input is invalid?
You'll see the parser error (line and column) in red. Fix the input and the output updates immediately.
Does it handle comments?
YAML comments are dropped because JSON has no equivalent. Going JSON → YAML produces a comment-free document.
Why did my version number 1.10 become 1.1?
Unquoted, it is a number, and 1.10 and 1.1 are the same number. Version strings, ZIP codes with a leading zero and anything else where the digits are an identifier rather than a quantity need quotes in YAML.
Are yes and no read as booleans?
Not here. js-yaml follows the YAML 1.2 core schema, where only true and false are booleans and yes, no, on and off stay strings. Older 1.1 parsers do convert them, which is the famous trap behind country code NO becoming false.
Related tools
INI ↔ JSON Converter
Round-trip between INI-style config files and JSON — supports sections, dotted nesting, comments, and value type inference.
Convert
.env File Parser
Parse a .env / dotenv file with full support for single-quoted, double-quoted, multi-line, and inline-comment values.
File
XML ↔ JSON Converter
Convert XML to JSON and back, with full attribute support, configurable attribute prefix and text key.
Convert
TOML ↔ JSON Converter
Convert between TOML (Cargo.toml, pyproject.toml, Hugo configs) and JSON — handles tables, array-of-tables, inline tables, typed scalars.
Convert
Fixed-Width Text Parser to CSV / JSON
Split fixed-width / fixed-column text into fields by column widths and export as CSV or JSON, in your browser.
Convert
CSV → HTML / Markdown / JSON Table
Convert CSV to an HTML <table>, a Markdown table, or a JSON array of objects — auto-detects the delimiter.
Convert