Convert YAML to JSON Online
Bidirectional YAML ↔ JSON converter with YAML 1.2 support, anchor/alias resolution, configurable indentation, and line-level error reporting. Everything runs in your browser — nothing is uploaded.
How to Convert YAML to JSON
ToolsPix YAML ↔ JSON Converter lets you convert YAML to JSON or JSON to YAML instantly in your browser. Paste or drag-and-drop your file, choose an indent preset, and click Convert — no upload, no signup.
Why use ToolsPix YAML Converter?
- Completely free with no file size limits or usage caps
- Private — all parsing runs in your browser, zero bytes leave your machine
- YAML 1.2 compliant via
js-yaml: anchors, aliases, and block scalars fully resolved - Line-level error reporting with exact line and column numbers
- Multiple output formats: 2-space, 4-space, tab, or minified JSON
Steps to convert YAML to JSON
Paste your YAML into the left panel (or drag-and-drop a .yaml file), select your preferred JSON indent from the dropdown, then click Convert. The JSON result appears on the right. Use Copy Result to grab it, Download to save a file, or Swap ↔ to reverse direction and convert JSON back to YAML.
Common YAML pitfalls
Mixed tabs and spaces cause parse errors — use spaces only. Strings starting with :, #, or ? must be quoted. The Norway problem (NO → false in YAML 1.1) does not apply here: YAML 1.2 requires explicit true/false.
FAQ
Is my input sent to any server?
No. Parsing and conversion run entirely in your browser using js-yaml loaded from a CDN. Once the page is open, no data leaves your machine.
Does it support YAML anchors and aliases?
Yes. Anchors (&name) and aliases (*name) are fully resolved during parsing, so the resulting JSON contains the expanded value at every reference point.
Why does my YAML produce a parse error?
The most common causes are inconsistent indentation, unquoted strings with special characters, and missing colons after mapping keys. The error message shows the line and column where parsing failed — start there.
Can I convert JSON Schema to YAML?
Yes — JSON Schema documents are just JSON, so paste them in JSON → YAML mode and you'll get a YAML representation. The schema semantics are preserved.
Are YAML comments preserved when round-tripping?
No. JSON has no concept of comments, so YAML comments are lost during YAML → JSON. Converting back to YAML produces clean, comment-free output. This is a fundamental limitation of the format, not a tool restriction.