MockFoxAdvertise

YAML to JSON Converter

Updated Free mock REST & WebSocket APIs

Paste YAML — a Docker Compose file, a Kubernetes manifest, a GitHub Actions workflow — and get the equivalent JSON. Anchors, aliases and merge keys are resolved, and if the YAML is broken you'll see exactly which line and column.

Paste, type, or drop a file onto the box.
JSON
Indent

🔒 Runs in your browser — nothing you paste is uploaded.

How to convert YAML to JSON

  1. Paste YAML or drop a .yaml / .yml file onto the input.
  2. The JSON appears instantly. Choose 2 or 4 spaces, and whether multiple --- documents become a JSON array.
  3. Fix any error shown with its line and column, then copy or download the JSON.

YAML features and their JSON result

YAMLJSON
port: 8080"port": 8080
version: "3.9""version": "3.9" (quoted stays a string)
enabled: yes"enabled": "yes" — YAML 1.2 only treats true/false as booleans
empty:"empty": null
&defaults / <<: *defaultsThe anchored keys are copied in
text: | blockA string with \n line breaks
# commentDropped — JSON has no comments

Most common YAML errors

  • Tabs for indentation. YAML only allows spaces. Replace tabs with two spaces.
  • Inconsistent indentation. Items of the same list or map must start in the same column.
  • A colon followed by text in a value. title: Note: read me is fine, but key: a: b isn't — quote the value.
  • Duplicate keys. Invalid in YAML 1.2; many parsers silently keep the last one. This converter reports them.

Related tools

Frequently asked questions

Is my YAML uploaded anywhere?

No. The conversion runs entirely in your browser with JavaScript, so your YAML never leaves your device and isn't logged or stored.

Which YAML version is supported?

YAML 1.2 (the current spec), via the open-source yaml library, including anchors, aliases, merge keys (<<), block scalars and multi-document streams.

What happens to comments?

JSON has no comments, so they're dropped. Keep the YAML file as your source if comments matter.

Does it work with Kubernetes multi-document files?

Yes. Files with several documents separated by --- become a JSON array (or untick the option to get only the first).

Your business here? Sponsor this tool from $16/week. See placements