# Free Online JSON to YAML Converter

> Convert JSON to YAML and YAML to JSON in the browser. YAML 1.2 parsing, so no becomes a string and 1.20 stays a version. Free online.

Canonical: https://stayslocal.app/dev/json-to-yaml-converter
Last updated: 2026-08-16

YAML is a superset of JSON, so every JSON document is already valid YAML — the interesting direction is what a YAML parser does to values that were never quoted. Both conversions run here in the browser, which matters because the YAML developers convert most often is a Kubernetes manifest or a CI config with credentials in it.

## YAML 1.2, and the traps from 1.1

This converts against YAML 1.2, whose core schema resolves only true and false as booleans. YAML 1.1 parsers — which include a lot of tooling still in production — also read y, yes, on, off, n and no as booleans. That is the Norway problem: a country list containing NO becomes false rather than Norway. The fix in either version is the same, quote the scalar.

Fields:
- Booleans: YAML 1.2 accepts true and false only. Under 1.1, yes/no/on/off/y/n also coerce — quote them to keep them as text.
- Version numbers: Unquoted 1.20 is the number 1.2 and the trailing zero is gone. A version belongs in quotes: "1.20".
- Leading zeros: A ZIP code or phone number like 01234 can be read as octal by a 1.1 parser and loses its zero in either. Quote identifiers that only look numeric.
- Indentation: Spaces only — the spec forbids tabs for indentation, and a stray tab is a parse error rather than a warning.
- Anchors and merges: &anchor, *alias and << merge keys have no JSON equivalent, so converting to JSON expands them into repeated data.

## How to convert JSON to YAML online

1. Paste JSON or YAML — The direction is picked from what you paste; multi-document YAML is fine.
2. Check the coerced scalars — Look at anything that was unquoted and could be read as a boolean, a number or a date.
3. Copy the result — Straight into a manifest, a workflow file or a request body.

## Where JSON to YAML conversion comes up

- Turning an example JSON config from documentation into a Kubernetes manifest.
- Reading a GitHub Actions workflow as JSON to reason about its structure.
- Converting a docker-compose file for a tool that only accepts JSON.
- Checking that hand-written YAML parses at all before a pipeline rejects it.

## Questions

**Do comments survive the conversion?**

No. JSON has no comment syntax, so YAML comments are dropped on the way to JSON and cannot be recovered on the way back. If the comments are the documentation for a config, convert a copy.

**Is my config uploaded anywhere?**

No. Parsing and serialising happen in this browser tab, so a manifest holding a registry credential or an environment secret never reaches a server.

**Why did my value no turn into false?**

That is YAML 1.1 boolean coercion, still present in plenty of parsers. We parse as YAML 1.2, where no stays a string — but the file may be read later by a 1.1 parser, so quote it anyway.

**Can it handle multiple documents in one file?**

Yes on the way in: --- separated documents parse into a JSON array. On the way back, an array of objects becomes a single YAML sequence rather than multiple documents, because that mapping is the unambiguous one.

## Related

- [JSON Formatter](https://stayslocal.app/dev/json-formatter): Format, validate and minify JSON
- [JSON ↔ CSV](https://stayslocal.app/dev/json-to-csv-converter): Convert JSON to CSV and back
- [Developer Tools](https://stayslocal.app/dev): every tool in this family
