Developer Tools

YAML to JSON Converter

Convert YAML to JSON and JSON to YAML in your browser: two-way conversion with live results, multi-document support, exact line and column error reporting, sample Kubernetes and Docker Compose files, copy and download, 100% private.

Your result will appear here.

🔒 Privacy: conversion runs locally in your browser. Your YAML and JSON are never uploaded, stored or seen by anyone else, so config files with internal hostnames or credentials stay on your device.

More developer tools

How this calculator works

YAML is the config format of modern infrastructure: Kubernetes manifests, Docker Compose files, GitHub Actions workflows and countless app configs are all YAML, while most APIs, scripts and data tools speak JSON. Moving data between the two by hand is slow and error-prone, one missed space changes the structure. This converter does it instantly and live: paste YAML and the JSON appears as you type, or flip the direction and paste JSON to get readable block-style YAML back. Everything runs in your browser, so your config files never leave your device.

The converter handles the real files people actually paste. Multi-document YAML, where several documents sit in one file separated by --- lines, becomes a JSON array with one entry per document. Anchors and aliases, the &name and *name shortcuts YAML uses to avoid repeating blocks, expand into plain values in the JSON. Going the other way, JSON becomes clean indented YAML with lists as dash items and nested objects as indented maps, ready to paste into a manifest. You can pick 2-space or 4-space JSON indent, or minified output for pasting into a script, and when something is wrong the error names the exact line and column, plus what went wrong, so a bad indent or an unclosed bracket is a one-minute fix instead of a guessing game.

One typing gotcha is worth knowing before you convert. YAML 1.1 parsers famously turned bare words like yes, no, on and off into booleans, which is how config files gained surprise true values. The YAML 1.2 core schema, which this tool follows, treats those words as plain strings, so yes stays the string "yes" and only true and false become booleans. If a value must be a literal word, quote it in the YAML and it will survive the round trip either way. For everyday work, that means Kubernetes and Compose files convert cleanly here, JSON from an API turns into config you can actually read, and nothing you paste is ever uploaded or stored.

Frequently asked questions

What is a YAML to JSON converter for?
It turns YAML config files into JSON data and back. Developers use it to inspect Kubernetes manifests and Docker Compose files as JSON, to feed YAML config into scripts and APIs that expect JSON, and to turn JSON from an API into readable YAML config. This tool does both directions, live, in your browser.
How do multi-document YAML files work here?
A YAML file can hold several documents separated by lines containing only ---. This converter parses every document and returns a JSON array with one entry per document, in order. Converting that array back to YAML writes the documents out again with --- separators.
Do anchors and aliases work?
Yes. Anchors (&name) and aliases (*name) are a YAML feature for reusing a block instead of repeating it, and merge keys (<<: *name) fold one mapping into another. The converter expands them into plain values in the JSON output, so the data is identical with no YAML-only shortcuts left in it.
Why did yes, no, on or off change type in my conversion?
That is the YAML 1.1 versus 1.2 difference. Older YAML 1.1 parsers turned bare yes, no, on and off into booleans, which surprised many people when a config value silently became true. The YAML 1.2 core schema, which this tool follows, treats those words as plain strings, so only true and false become booleans. If you mean the literal word, quote it in YAML ("yes") and it stays a string in every parser.
Is my YAML uploaded anywhere?
No. Conversion, parsing and error reporting all run locally in your browser with js-yaml. Your files are never uploaded, stored or seen by anyone else, which makes the tool safe for config files that contain internal hostnames, secrets or credentials, though you should still avoid pasting live secrets anywhere you do not have to.
Disclaimer: Results are estimates for planning purposes only and are not financial advice. Actual loan terms, taxes and investment returns vary. Consult a qualified professional before making financial decisions.