JSON ↔ YAML converter
Move configuration between formats: JSON from an API into a Kubernetes, Docker Compose or CI file, or a YAML config into JSON for a script.
Runs in your browser. Nothing is uploaded.
Loading tool…
How to use
- Choose JSON → YAML or YAML → JSON.
- Paste JSON or YAML.
- Copy or download the result.
Common uses
- Turn JSON from an API or a generator into YAML for a Kubernetes, Docker Compose or GitHub Actions file.
- Convert a YAML config to JSON so a script or a JSON-only tool can read it.
- Check a YAML file for syntax errors by converting it and reading the error position.
Example
- Input
- {"name":"app","ports":[80,443],"debug":false}
- Result
- name: app ports: - 80 - 443 debug: false
Good to know
- Standard: YAML 1.2, read by a widely used parser.
- YAML → JSON: only the first document is read. Comments are dropped, because JSON has none.
- Dates: 2026-03-01 becomes a date string in JSON.
- JSON → YAML: 2-space indent. Values like “yes” or “08” are quoted so they stay text.
- Errors: shown with the line and column.
- Text stays in your browser tab and is not saved.
Questions
Why are some strings quoted in the YAML?
Values like yes, no, on, 08 or 1e3 would be read as booleans or numbers by some YAML parsers. Quoting keeps them as text.
Will the key order be kept?
Yes, in both directions, which keeps diffs small. The one exception is keys that are whole numbers, such as 10, which JavaScript always puts first in numeric order.
Why did my yes or no values change?
YAML 1.2 treats only true and false as booleans, so yes and no stay as text when read. When writing YAML, such words are quoted so older parsers do not turn them into booleans.
Does it support multiple YAML documents separated by ---?
Only the first document is converted. Split the file and convert each part separately.
Are anchors and aliases supported?
Yes. When converting YAML to JSON, aliases are expanded into full copies of the referenced values.