How to use the YAML to JSON Converter
- 1. Pick a directionYAML to JSON, or JSON to YAML.
- 2. Paste your fileA Docker Compose, Kubernetes, GitHub Actions or app config file.
- 3. ConvertCopy or download the result, or read the exact error line.
YAML and JSON compared
YAML and JSON describe the same kinds of data: maps (objects), lists (arrays), strings, numbers, booleans and null. YAML uses indentation and is easier for people to write, which is why Docker Compose, Kubernetes, GitHub Actions and Ansible use it. JSON uses braces and quotes and is easier for programs, which is why APIs use it.
Converting with js-yaml, a widely used open-source parser, avoids hand-editing mistakes. It uses the safe JSON schema, so YAML tags that could create special objects or run code are never used. Comments are dropped going to JSON, because JSON has no comments.
Worked example
The sample config becomes JSON with "server": { "port": 8080, "debug": false }, a databases array of 2 objects, and "tags": ["python", "sql"]. Notice that 8080 and false become a real number and boolean, while 10.0.0.5 stays a string.
Common YAML mistakes the converter will point out with a line number:
- Tabs: YAML indentation must use spaces.
- Misaligned items: list items and keys at the same level must line up exactly.
- Unquoted special text: values with a colon and space, or starting with @ or *, need quotes.
A YAML file with several documents separated by --- becomes a JSON array, one item per document.
Frequently asked questions
Why did yes or no not become true or false?
With the safe JSON schema, only true and false are booleans. Old YAML 1.1 rules turned yes and no into booleans, which caused many bugs.
Will the YAML output keep my key order?
Yes. Keys appear in the same order as in your JSON.
Is my config uploaded?
No. Conversion runs in your browser with js-yaml loaded from cdnjs.
Is the yaml to json converter free?
Yes, it is free. Your first conversion asks for your name and WhatsApp number once, and after that the yaml to json converter and every other Uncodemy tool open without the form.