YAML → JSON
Parse YAML and emit pretty-printed JSON.
Private by design. Your input never leaves this browser. Conversions run locally on your device.
What this tool handles
- Dates in the YAML document become ISO 8601 strings.
- NaN and Infinity become null.
- Tabs used for indentation are rejected, and the error carries the line and column.
- Multi-document YAML is not supported; one document per conversion.
Example
YAML
name: Ada
active: true
ports:
- 80
- 443
JSON
{
"name": "Ada",
"active": true,
"ports": [
80,
443
]
}
When you would use it
- Querying a GitHub Actions workflow — Turn .github/workflows/ci.yml into JSON so you can pull out job names or matrix entries with jq instead of grepping indented text.
- Helm values against an API payload — Convert a values.yaml fragment to JSON and diff it against what the cluster API actually returned, without the indentation getting in the way.
- An OpenAPI spec for a generator — Most YAML-authored OpenAPI documents have to be handed to client generators and schema validators as JSON. This does that one step.
- Ansible vars into a test fixture — Paste a group_vars block and get a JSON object you can drop straight into a unit test or a mock response.
Common questions
Are anchors, aliases and merge keys resolved?
Yes. An &anchor referenced by *alias is written out in full wherever it was used, and a << merge key is flattened into the mapping that inherits it. The JSON has no reference back to the original anchor.
Does "on:" in a workflow file become true?
No. Parsing follows the YAML 1.2 core rules, so on, off, yes and no all stay strings; only true and false become JSON booleans.
What happens to duplicate keys?
The document is rejected rather than silently collapsed. The error reads "duplicated mapping key" and carries the line and column of the second occurrence.
Do large integers survive the conversion?
Not beyond 2^53. YAML integers are read as JavaScript numbers, so 12345678901234567890 comes out as 12345678901234567000. Quote the value in the YAML if the exact digits matter.
Related tools
- JSON → YAML — Convert JSON to readable YAML with configurable indentation.
- Convert any format — Pick an input format and an output format and convert between any pair.
- JSON → TOML — Convert a JSON object to TOML.
- TOML → JSON — Parse TOML configuration into JSON.
- JSON → CSV — Turn an array of objects into a CSV table.
- CSV → JSON — Parse CSV or TSV into JSON, with delimiter detection and optional type coercion.