YAML ↔ JSON Converter
Convert between YAML and JSON in either direction. Useful for Kubernetes manifests, CI configs, and OpenAPI specs.
Enter input above to see the result.
What is this for?
YAML and JSON describe the same things — nested maps, lists, primitives — but trade off readability vs strictness. YAML is friendlier for humans (Kubernetes manifests, GitHub Actions, OpenAPI, most CI configs); JSON is what APIs and machine-readable formats ship. This converter flips between them losslessly for the structures both can express. YAML uses js-yaml (YAML 1.2); JSON uses the native API. Both directions run in your browser.
When to use it
- Pasting an OpenAPI / k8s / docker-compose YAML into a tool that needs JSON.
- Converting an API response (JSON) into YAML for a config file.
- Auditing a YAML file's actual structure when ambiguous indentation makes parentage unclear.
Common gotchas
- The "Norway problem". YAML 1.1 coerced
NO,YES,ON,OFFinto booleans. YAML 1.2 doesn't, but downstream parsers may. Quote ambiguous strings to be safe. - Multi-document YAML (
---separators) — only the first document is converted. - Custom tags (
!!python/object,!Ref, etc.) violate strict YAML 1.2. CloudFormation YAML and PyYAML pickle dumps will fail; clean tags first. - Anchors and aliases get expanded on YAML→JSON. JSON has no references, so
*refnodes inline. Round-tripping gives a value-equivalent but textually-larger YAML. - Numbers vs strings. Unquoted YAML
3.14is a float;"3.14"is a string.