YAML to JSON
Paste YAML and get JSON instantly, indented or minified, with parse errors that point at the line.
Converted live as you type. Nothing leaves your browser.
Indentation
JSON
How to convert YAML to JSON online
Paste your YAML
Drop a YAML document into the input. The JSON appears live as you type, and parse errors are shown with the line and column where they occur.
Pick the indentation
Choose 2 spaces, 4 spaces, or minified output next to the result. The JSON regenerates the moment you switch.
Copy the JSON
Click Copy JSON to take the result to your editor, terminal, or API client.
Why use this tool
Indented or minified output
2 spaces, 4 spaces, or a single minified line with no whitespace. The output regenerates instantly when you switch.
Errors with line numbers
Invalid YAML shows the parse error together with the line and column where parsing failed, and clears as soon as the input is valid again.
Handles real YAML
Nested mappings and sequences become nested objects and arrays. Anchors and aliases are resolved into the values they reference.
Multi-document streams
A stream with several documents separated by --- converts to a JSON array, one element per document, with a note under the output saying so.
One direction, clearly
This page converts YAML to JSON only, so the labels and errors always mean the same thing. The reverse trip has its own tool.
Configs stay on your machine
The conversion runs in your browser, so pipeline files and manifests that name internal hosts, tokens, or secrets are never uploaded.
About this tool
This tool converts YAML to JSON in your browser. Paste a YAML document and the JSON equivalent appears as you type, indented with 2 or 4 spaces or minified to a single line. Nested mappings become objects, sequences become arrays, and anchors and aliases are resolved into the values they reference. A stream of several documents separated by --- lines converts to a JSON array with one element per document, and a note under the output says when that happened.
Most YAML lives in configuration: CI pipelines, Kubernetes-style manifests, and application config files. The tooling around those files often speaks JSON instead. APIs expect JSON request bodies, validators and schema checkers consume JSON, and most scripting languages parse it natively. Converting a YAML file is the quickest way to feed a config into any of them, or simply to see what a tricky block of YAML actually parses to. When the input is invalid, the inline error reports the line and column where parsing failed, which turns a vague indentation complaint into a specific place to look.
Those same config files are a poor fit for converters that upload your input, since they routinely contain internal hostnames, tokens, and secrets. Here nothing leaves your browser. After converting, the JSON formatter can validate or restyle the result, values lifted from a manifest can be decoded with the Base64 tool, and tabular data headed the same way can go through the CSV to JSON converter. For the reverse direction, turning JSON into YAML, use the JSON to YAML converter.
Frequently asked questions
- Does this convert JSON back to YAML?
- No. This page converts YAML to JSON only. The JSON to YAML converter handles the reverse direction.
- Is my YAML uploaded anywhere?
- No. The conversion runs entirely in your browser. Nothing is sent to a server, stored, or logged, which matters for config files that carry credentials or internal hostnames.
- What happens with multi-document YAML?
- A stream containing several documents separated by --- converts to a JSON array with one element per document, and a note under the output tells you when that happened. A single document converts to its JSON value directly.
- How are anchors, aliases, and comments handled?
- Anchors and aliases are resolved, so the JSON contains the expanded values they reference. Comments are dropped because JSON has no way to represent them.
- Why does my YAML show an error?
- YAML is indentation-sensitive, so a stray tab or a misaligned key is the usual cause. The inline error reports the line and column where parsing failed, and it clears the moment the input becomes valid.
- Can I get minified JSON?
- Yes. Choose Minified next to the output and the JSON collapses to a single line with no whitespace, ready for a query parameter or a compact payload.
Related tools
JSON Formatter & Validator
Pretty-print, minify, or explore JSON as a collapsible tree, with syntax errors shown inline.
JSON to YAML
Convert JSON to YAML and YAML back to JSON, in both directions, with your choice of indentation.
Angle Converter
Convert an angle between degrees, radians, gradians, turns, arcminutes and arcseconds, with a degrees-minutes-seconds breakdown.
Area Converter
Convert area between metric and imperial units instantly.
Binary to Decimal Converter
Convert a binary number to its decimal value, with hexadecimal and octal readouts.
Celsius to Fahrenheit Converter
Convert Celsius to Fahrenheit instantly, and edit either side to convert back.