YAML to JSON

Convert YAML.

Loading tool…

What is YAML, and why convert it to JSON?

YAML is the configuration language of modern infrastructure. It expresses the same structures as JSON — mappings, sequences, scalars — but with indentation instead of braces, optional quoting, comments, and features like anchors and aliases that let one block be reused elsewhere in the document. It is pleasant to write and, for the same reasons, easy to get subtly wrong.

Converting to JSON resolves all of that into an explicit structure: anchors are expanded, implicit types are made concrete, and every string is quoted. That is useful precisely because it removes ambiguity — you can see exactly what a parser will hand your application, including whether version: 1.10 was read as a number and whether enabled: no became a boolean rather than the word "no".

Why we built this tool

Developers convert YAML to JSON to feed configuration into code, to inspect what a manifest really contains after aliases are resolved, to run a document through JSON-only tooling, or to check a CI pipeline definition before pushing a commit that would otherwise fail.

Those manifests map your infrastructure, and pasting them into an online converter exposes that map to someone else. Ours parses YAML entirely in the browser using a JavaScript parser, so nothing is transmitted and no copy exists outside your tab. There is no document size limit and no account, and once the page has loaded the tool keeps working with the network off — which is exactly when you tend to be debugging a broken config.

Tips and common mistakes

  • Watch for values that were implicitly typed — an unquoted no arrives as false in the JSON.
  • Anchors and aliases are expanded during conversion, so a compact YAML file can produce a much larger JSON document.
  • Multi-document YAML files, separated by three dashes, do not map to a single JSON document.
  • A parse error naming a line is usually an indentation problem a few lines above it.

Open YAML to JSON with a link

YAML to JSON can be handed its input by the link that opens it, so the page arrives with the work already done. This is meant for assistants and scripts: if a chatbot, an editor extension, or a command-line agent already holds your content, it can build a link instead of asking you to copy and paste into a box.

The payload rides in the fragment — the part of a URL after the #. Browsers never send the fragment to a server, so anything handed over this way stays on your device exactly as a dropped file would. A link that uses the query string instead is rewritten into the fragment by the page before any analytics or ad script can read the address.

Prefix any field with gz#gztext= — to pass it as gzip-compressed base64url, which fits roughly five to ten times more into the same link. Links stay reliable up to about 8,000 characters; past that, chat apps and address bars start truncating them, and the page says so rather than loading half a document.

One exception to the privacy rule: ?url= tells the page to download the input from an address. That request goes from your browser straight to that server — not through ours — but it does leave your device, and it only works if the server allows cross-origin requests.

With My Gadgets installed as an app, a .yaml file opened from your desktop lands straight in this tool. The file is read locally, exactly like a drop.

  • #text= — the text to work on

Example: https://mygadgets.ink/tools/yaml-to-json/#text=...

Quick start: using YAML to JSON

  1. Paste your YAML document into the input above.
  2. Run the conversion; a parse error will name the line that broke it.
  3. Read the JSON output and confirm the types are what you intended.
  4. Watch for version numbers, times, and yes/no values that changed type.
  5. Copy the JSON or download it for use in your code.

Convert back with JSON to YAML, or pretty-print the result using JSON Formatter.

Related Developer Tools

Browse all Developer Tools →