YAML to JSON Converter
Convert YAML to JSON and JSON back to YAML — properly parsed, both directions.
YAML and JSON describe the same shapes — objects, lists, strings, numbers, booleans and null — in two very different costumes. Configuration lives in YAML (Kubernetes, GitHub Actions, docker-compose), APIs speak JSON, and sooner or later everyone needs the same document in the other costume.
How to use
- Pick the direction: YAML → JSON or JSON → YAML.
- Paste your document into the box — conversion happens as you type.
- If something is invalid, the error names the problem (and, for YAML, usually the line and column).
- Copy the output, download it as a file, or press “Use output as input” to convert straight back.
About this tool
This converter uses a real YAML parser (js-yaml, loaded from this site, running in your browser), not line-by-line text substitution, so anchors, nested lists, quoted strings that merely look like numbers, and multi-line blocks all survive the trip. JSON → YAML uses the same parser in reverse and produces the indented, comment-free YAML you would expect.
Three limits worth knowing. YAML comments have nowhere to live in JSON, so they are not carried across. YAML-specific tags and multi-document streams (--- separators) are not supported — convert one document at a time. And keys in JSON are always strings, while YAML allows other key types; non-string keys are stringified on the way to JSON. Your documents are never uploaded or stored.
Frequently asked questions
Is my YAML or JSON uploaded?
No. The parser runs in your browser on this device. Nothing you paste is sent anywhere, which makes the tool safe for configuration files — though you should still never paste live secrets into any web page out of habit.
Why did my numbers come back as strings (or the other way)?
YAML is loosely typed: an unquoted 0123 may be read as the number 123 or, in YAML 1.1, as octal 83; a quoted "0123" is always the string. js-yaml follows YAML 1.2 core rules, so review values that carry leading zeros — ports, versions and IDs are the usual casualties.
What happens to comments?
They are dropped. JSON has no comment syntax, so comments in YAML cannot cross over, and converting back cannot restore them. Keep the original file if the comments matter.
Can it convert multiple YAML documents (--- separated)?
No — paste one document at a time. A --- separator raises an error rather than silently converting only the first document.
The error mentions a line and column — which input line?
The line and column in your pasted input where the parser gave up. YAML is whitespace-sensitive: a tab character or one missing space of indentation is the usual cause.
First time embedding? Read the step-by-step guide →
More free tools
XML to JSON Converter
Convert XML to JSON and JSON back to XML — a real parser, both directions, in your browser.
CSV to JSON Converter
Convert CSV to a JSON array — proper quoted-field parsing, delimiter and header options, files processed locally, never uploaded.
JSON to CSV Converter
Turn a JSON array into CSV instantly.
Base64 Encode / Decode
Encode text to Base64 or decode it back.
Color Converter (HEX ↔ RGB)
Convert HEX to RGB and back, with live preview.
Unit Converter
Convert length, weight and temperature instantly.