YAML ↔ JSON Converter
Both directions. Client-side. Anchors resolved, YAML 1.2 semantics, real live output.
How to use
Pick a direction with the tabs — YAML → JSON or JSON → YAML. Paste your input on the left. The converted output appears on the right as you type.
Set indent size (both directions), and for JSON→YAML you can sort keys alphabetically or force parts of the output into inline flow syntax.
Keyboard shortcuts
Three shortcuts:
| Cmd / Ctrl + K | Focus the input pane |
| Cmd / Ctrl + Enter | Copy output to clipboard |
| Cmd / Ctrl + / | Toggle direction |
When to use it
YAML and JSON carry the same shape of data; they differ in syntax. Which one is right depends on where the data lives.
- Kubernetes, Ansible, Docker Compose, CircleCI, GitHub Actions all use YAML — comments and readability win.
- APIs, config exports, log payloads use JSON — universal parser support, no whitespace-sensitivity gotchas.
- Converting between them lets you author in one and ship in the other.
Options
Indent — 2 spaces, 4 spaces, or tab (JSON only; YAML doesn't allow tabs for indentation).
Sort keys (JSON→YAML only) — sorts object keys alphabetically. Useful for diff-friendly config files.
Inline from depth (JSON→YAML only) — forces mappings and sequences at or beyond this depth into inline flow syntax ({a: 1, b: 2} instead of block form). Set to Never for pure block style.
Format-specific gotchas
YAML anchors and references are resolved. Input like <<: *defaults merges the referenced mapping into the output — JSON has no anchor concept, so it's expanded.
Comments disappear. JSON has no comments; YAML→JSON drops them silently.
YAML tabs are illegal for indentation. Block YAML mandates spaces. If you set indent to Tab and switch to JSON→YAML, the output uses 2 spaces regardless.
YAML type coercion. Unquoted yes, no, on, off become booleans in older YAML 1.1 mode. This tool uses YAML 1.2 (js-yaml default), so only true/false/null coerce.
Bidirectional round-trip isn't always identical. YAML has many ways to write the same data; converting to JSON and back may produce cleaner but different YAML.
Privacy
Everything runs in your browser. Your YAML and JSON never leave the page — no server, no logging, no analytics on the content.