YAML to JSON
Convert YAML into formatted JSON.
Something went wrong
Processed locally in your browser. Nothing you type here is sent to our servers.
What does this tool do?
This converts YAML — Docker Compose files, Kubernetes manifests, CI workflows, application config — into formatted JSON. Parsing is done by js-yaml in your browser, and when the YAML will not parse you get the line and column of the problem, which for YAML is nearly always an indentation mistake.
How to use it
- Paste your YAML into the input panel.
- Press Convert to JSON, or ⌘/Ctrl + Enter.
- Pick your indentation, or choose Minified for a single line.
- Copy the JSON or download it.
How YAML types are converted
Parsing uses the JSON schema, which restricts the result to types JSON can actually represent:
trueandfalsebecome JSON booleans.nulland~becomenull.- Unquoted numbers become JSON numbers; quoted ones stay strings.
- Dates are kept as strings rather than being turned into date objects, so they survive the round trip unchanged.
- Anchors and aliases are expanded — the JSON contains the full value at each reference.
Common use cases
- Feeding a YAML config into a tool or API that only accepts JSON.
- Checking exactly how a YAML parser interprets an ambiguous value.
- Converting a manifest so you can query it with
jq. - Debugging indentation problems — the error message points at the exact line.
Limitations
- Comments are lost. JSON has no comment syntax, so every
#line disappears. This conversion is one-way in that respect. - Only the first document is converted. A file with
---separators contains multiple YAML documents; JSON has no equivalent, so only the first is used. - Non-string mapping keys are coerced to strings, because JSON object keys must be strings.
- Custom tags such as
!Ref— common in CloudFormation — are not resolved and will be reported as unknown.