YAML to JSON Converter
Convert YAML to JSON as you type.
Paste YAML or upload a file. Nothing is sent to a server.
The JSON appears here as you type.
What Is a YAML to JSON Converter?
A YAML to JSON converter turns YAML, the format used by Kubernetes manifests, Docker Compose files and CI pipelines, into JSON that APIs, scripts and other tools can read. Both formats describe the same kinds of data, so the structure stays the same and only the syntax changes.
This converter runs in your browser, your YAML is not uploaded to Geekflare servers.
How to Use It
- Paste YAML on the left, or upload a
.yamlor.ymlfile. - The JSON appears on the right as you type.
- Choose the JSON indentation, or pick Minified for a single line.
- Copy the JSON or download it as a
.jsonfile.
If the YAML has a syntax error, the output lists each error with its line. Select a line to jump to it.
How YAML Maps to JSON
| YAML | JSON | Notes |
|---|---|---|
name: web | {"name": "web"} | A mapping becomes an object |
- web | ["web"] | A sequence becomes an array |
port: 8080 | {"port": 8080} | Unquoted numbers stay numbers |
port: "8080" | {"port": "8080"} | Quoted values stay strings |
timeout: null or timeout: ~ | {"timeout": null} | Both forms of null become null |
# comment | Removed | JSON has no comments |
*defaults | A copy of the anchored value | Aliases are expanded in place |
<<: *defaults | The anchored keys, merged in | Keys set next to the merge win over merged ones |
.inf or .nan | null | JSON has no Infinity or NaN, so the tool flags these |
Values That Can Surprise You
The tool follows YAML 1.2, which most current parsers use, and a few values read differently than in older YAML 1.1 files:
yes,no,onandoffstay strings. Onlytrueandfalseare booleans. Add%YAML 1.1and---at the top of the file to read them the older way.- Dates such as
2026-11-04stay strings, since JSON has no date type. - Integers above 9,007,199,254,740,991 lose precision in JSON numbers, so the tool flags them. Quote them to keep every digit.
- Custom tags such as
!Refin CloudFormation templates are flagged and dropped, and the tagged value is kept.
Multiple Documents
YAML files can hold several documents separated by ---, as Kubernetes manifests often do. JSON has no equivalent, so the tool puts them in one array, in order. A file with a single document converts to that document without an array.
Common YAML Errors
| Error | Usual cause | Fix |
|---|---|---|
Tabs are not allowed as indentation | A tab was used for indentation | Indent with spaces |
Implicit keys need to be on a single line | A missing colon, or a value that runs over onto the next line | Add the colon, or quote the value |
All mapping items must start at the same column | Keys at the same level have different indentation | Line the keys up |
Map keys must be unique | The same key appears twice in one mapping | Remove or rename one of them |
Unresolved alias | *name is used without a matching &name before it | Define the anchor before using it |
After You Convert
To check that the JSON has the shape you expect, create a schema from it with the JSON Schema Generator, then test other files against that schema with the JSON Schema Validator.