YAML to JSON Converter
Convert YAML to JSON and back, with what the conversion costs stated rather than dropped.
Paste YAML or JSON. The direction is detected.
How it works
Converts in both directions and tells you what the conversion cost. The direction is detected from the input — a
JSON document has to start with { or [ and parse as JSON, and almost nothing else
does — so there is normally nothing to choose.
Why an unquoted NO stays a string here
This parses against the YAML 1.2 core schema, under which only true and false are
booleans. Under the older 1.1 schema, y, yes, on and NO all
resolve to booleans as well — which is how a list of country codes quietly turns Norway into false. A
converter that retypes values is editing rather than converting, so the values you wrote are the values you get,
and the ones whose type is easy to assume wrong are listed out so you can check instead of trusting.
Two more 1.1 habits the core schema drops: 0777 is the decimal number 777 here (1.1 read a leading
zero as octal, 511; write 0o777 for octal), and 2026-09-20 stays a string rather than
becoming a date object. If the consumer of your file is a 1.1 parser, such as PyYAML, it will read both
differently.
What JSON cannot carry
Comments, anchors and aliases, multiple documents, and merge keys. Each is counted before the conversion runs and
reported alongside the result rather than discarded in silence — in a manifest, the comment above a value is often
the only surviving record of why it was set that way. The merge key is the surprising one: << is
a YAML 1.1 extension rather than part of the core schema, so it comes through as a literal key holding the
referenced map instead of being merged into its parent. .inf and .nan are counted too:
JSON has no way to write them, so each becomes null.
Safe to paste something hostile
Only plain data is constructed — a tag that would build a function, a regular expression or a custom type is an
error, and a __proto__ key stays an ordinary key. Aliases are the other risk: a few hundred bytes of
nested anchors can expand to billions of values (the "billion laughs" document). The expanded size is measured
before anything is written out, and a document that would pass a million values is refused rather than expanded.
Syntax, not schema
A clean result means the document parses. It does not mean it is a valid Kubernetes manifest, Compose file or pipeline definition — that needs the schema for a specific tool at a specific version, which this page does not carry and would go stale if it did. For the JSON side alone, the JSON Formatter reports duplicate keys and locates a syntax error by line and column.
Example
The sample above converts to JSON with "region": "NO" and "version": "3.10" intact.
Remove the quotes from "3.10" and it becomes the number 3.1, because unquoted they are
the same number — which is why the ambiguous-value list exists.
Frequently asked questions
Will an unquoted NO become false?
No, and that is deliberate. This uses the YAML 1.2 core schema, under which only true and false are booleans. Under a 1.1 schema y, yes, on and NO all resolve to booleans — the Norway problem, which silently turns a country code into false. A converter that retypes values is editing, not converting.
What happens to my comments?
They are lost, because JSON has no comment syntax. They are counted first and the count is reported, since in a manifest the comment above a value is often the only surviving record of why it was set that way.
Why did version: 3.10 become 3.1?
Because unquoted it is a number, and 3.10 and 3.1 are the same number. Quote it — "3.10" — if it is a version rather than a quantity. The ambiguous-value list on this page exists to surface exactly this case before it reaches something that cares.
What happens to anchors and aliases?
They are resolved into their values, so the output is equivalent but the shared definition becomes repeated content that will drift if edited. Converting the other way does not recreate them: JSON has no way to say two values were once one.
Why does my merge key come through as a "<<" key?
The merge key is a YAML 1.1 extension, not part of the 1.2 core schema. Rather than pretend otherwise, the conversion reports it and leaves the literal key in place so you can expand it by hand if the consumer expects the merged shape.
Is my configuration sent anywhere?
No. Parsing and serialising both run in your tab. That matters for this tool in particular, since the documents people convert are manifests and CI configurations that routinely carry hostnames, internal paths and secret references.
Related tools
JSON Formatter & Validator
Format, validate and measure JSON, with errors located by line and column.
LocalBase64 Decoder
Decode Base64 and Base64URL back to text or raw bytes.
LocalEnv File Converter
Convert between .env, JSON and YAML — the same config in three syntaxes.
LocalINI ⇄ JSON Converter
Convert INI to JSON and back, with sections becoming nested objects.
LocalTOML to JSON Converter
Parse a TOML document — tables, arrays of tables and all — into JSON.
LocalDocker Compose Validator
Check a Compose file for the mistakes that stop it loading — before you find out with docker compose up.
Local