JSON / YAML converter

How to use the JSON / YAML converter

  1. Pick a direction: JSON → YAML or YAML → JSON.
  2. Paste your input on the left; the converted output appears on the right instantly.
  3. Adjust indent (2 or 4 spaces) and (for YAML output) toggle key sorting and flow-level threshold.
  4. Errors include line and column so you can fix the source quickly.
  5. Copy the converted output to your clipboard or download as `.yaml` / `.json`.

When to use it

Use it when migrating GitHub Actions workflows between teams, converting Kubernetes manifests, or normalizing API contracts. YAML is friendlier to write by hand; JSON is friendlier for APIs. Round-tripping keeps both copies in sync. Alternative: `yq` on the command line does the same thing for build pipelines; this tool wins for one-off browser conversions.

Frequently asked questions

Does the converter preserve comments?
JSON has no comment syntax, so YAML→JSON drops comments. JSON→YAML output has no comments to preserve. If you maintain comments in YAML, keep YAML as the source of truth.
How are YAML anchors/aliases handled?
On YAML→JSON, references are expanded inline (each anchor becomes its own copy). On JSON→YAML, repeated references aren't auto-anchored; if you need anchors, add them manually after conversion.
What about YAML's special types (dates, octals)?
YAML 1.1 auto-parses many literals as typed values (Norway problem: `no` → false). The converter uses YAML 1.2 strict mode where most literals stay as strings, matching modern parsers.
Why are tabs flagged as invalid YAML?
YAML forbids tab characters in indentation — only spaces. If your YAML mixes tabs and spaces, the parser will reject it with a 'tab character cannot start a token' error.
Can I convert nested complex structures?
Yes — arbitrarily nested objects, arrays, and primitives convert cleanly in both directions.
Does the tool handle multi-document YAML (---)?
Currently single-document only. Split multi-document YAML files manually before pasting, or use `yq -s` to handle them programmatically.

Related tools

  • Free YAML Formatter & Validator
  • Free JSON Formatter
  • Free CSV to JSON Converter
  • Free XML Formatter

Last updated: 2026-04-27