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.
