Online YAML and JSON bidirectional converter: YAML to JSON, JSON to YAML. Preserves data structure, supports nested objects and arrays.
TL;DR: Free online YAML and JSON bidirectional converter. Convert YAML to JSON or JSON to YAML while preserving data structure. Supports nested objects and arrays, runs locally.
For local tools, open DevTools → Network and search your input — it should not appear in requests.
Next steps
Usage Guide
YAML is for humans (K8s, CI, Compose); JSON is for programs (APIs, config delivery). Converting both ways is daily work — and a magnet for indent bugs. This tool converts in both directions and surfaces targeted YAML error hints. Parsing stays local; your config never uploads.
1. YAML ↔ JSON
The default sample already mixes maps and lists — run it once, then swap in your own file. Structure is preserved, but YAML comments disappear in JSON. That is a format limit, not a missing feature.
- YAML → JSON: paste YAML on the left, convert, and read equivalent JSON on the right.
- JSON → YAML: paste JSON and convert back to indented YAML.
- On failure, read the hints: mixed indent, missing space after colons, list dash placement, and more.
2. YAML traps that catch everyone
On the JSON side, trailing commas, single quotes, and raw newlines are the usual breakers. Fix JSON in the formatter first, then convert to YAML.
- Tabs mixed with spaces: YAML forbids tab indent; the editor can look aligned and still fail.
- Space after colon is required: key:value is illegal; key: value is legal.
- List dashes and nesting depth: children must sit one level deeper than parents.
- Unquoted specials: strings with colons, #, or braces are safer inside quotes.
3. Where it fits
Next: use JSON Diff when structures must align; use JSON→TypeScript / Go / Java when you need types. This page only swaps formats — business schema checks belong in the JSON Schema validator.
- Turn docker-compose / GitHub Actions YAML into JSON for JSON-only toolchains.
- Turn API JSON into YAML for human-readable design docs.
- Normalize two "identical looking" configs to one format before diffing.
4. Large integers and precision edges
JSON numbers in the browser follow IEEE-754: integers beyond 2^53-1 lose precision. On the JSON→YAML path this page tries to keep oversized integers as strings; YAML→JSON is still limited by the parser's number type — quote order IDs and snowflake IDs as strings at the source. A successful convert is not the same as a lossless round-trip: lost precision often shows up in diffs as "the number just changed".
5. Multi-docs and anchors this page does not cover
- --- separated multi-document YAML is common in Helm/K8s manifests; this page parses a single document — split first.
- Anchors and aliases (&anchor / *alias) are YAML-only reuse; JSON expands them into duplicated structures and drops the alias names.
- YAML boolean dialect forms (yes/no/on/off, ~) become true/false/null — quote them if you meant the string "yes".
6. Format-then-convert workflow
Dirty JSON (trailing commas, pseudo-JSON comments) should pass a JSON formatter/validator before this page; dirty YAML should be fixed from this page's indent hints. Once both sides are valid, review changes with text diff or JSON diff. Treat the converter as a syntax gate, not a "paste anything and ship it" button.
FAQ
Chiefly YAML comments: they are inevitably dropped on the way to JSON — a format-capability gap, not a tool defect, so keep the YAML master if comments matter. The data structure itself round-trips equivalently.
Possibly. Browser JSON numbers are bounded by 2^53-1: JSON→YAML tries to write oversized integers in a digit-preserving form, while YAML→JSON is still limited by the parser. For order IDs and snowflake IDs, strings at the source are the safe choice.
This page parses a single document, so split --- separated multi-docs (common in Helm/K8s manifests) first. Anchors and aliases (&anchor / *alias) expand into duplicated structures and the alias names are dropped; yes/no/on/off and ~ parse as booleans or null, so quote them if you want strings.
Mostly one of four: tabs mixed with spaces (YAML forbids tab indentation); a colon without a space after it (key: value is the legal form); a list dash indented shallower than its parent; and unquoted strings containing colons, #, or {}. The page names these specifically. On the JSON side, trailing commas and single quotes are the usual suspects — run it through a formatter first.
Typical cases: turning docker-compose or GitHub Actions snippets into JSON for JSON-only tooling; turning API responses into YAML for human-readable design docs; and unifying two visually identical configs into one format before diffing. Use JSON Diff for structural comparison and JSON→TypeScript/Go/Java for type generation — this page does not validate business schemas.
Yes: parsing runs entirely in your local browser, the config never leaves your machine, and there is no usage gate.
Related Tools
Related Articles
Online JSON/YAML Converter: Convert Between Configuration Formats
Learn how to convert between JSON and YAML formats for configuration data. Understand the differences between JSON and YAML, and use cases in DevOps and configuration management.
Complete Guide to YAML JSON Conversion: Principles, Tools, and Pitfalls
Deep dive into the differences and connections between YAML and JSON. Master bidirectional YAML JSON conversion methods — online tools, CLI, code implementations, YAML 1.1 vs 1.2 traps, anchors and merge keys, multi-document streams.
Online XML/JSON Converter: Convert Between Data Formats
Learn how to convert between XML and JSON: @-prefixed attributes, CDATA, array folding, and line-level parse errors for API and legacy integrations.