YAML to JSON Converter
Turn a YAML file into JSON for an API, a script or a JSON schema check, right in your browser.
Convert YAML to JSON Online
YAML is pleasant to write but many tools only accept JSON: API requests, JSON Schema validators, JavaScript code and a lot of cloud consoles. This page is the JSON Converter set to YAML input and JSON output, so a Kubernetes manifest, a Compose file or an OpenAPI spec becomes JSON in one paste.
The YAML parser is loaded into the page and runs locally; the file is never uploaded.
How YAML types come out in JSON
| YAML | JSON |
|---|---|
port: 8080 | The number 8080 |
debug: true | The boolean true |
value: ~ or value: null | null |
date: 2024-01-01 | The string "2024-01-01" |
answer: yes | The string "yes" |
The last two rows are where YAML parsers disagree. Older YAML 1.1 parsers read yes as true and turn dates into timestamps; this converter follows the YAML 1.2 core schema, where they stay strings, which is also what most modern libraries do.
When the YAML is invalid
Indentation mistakes are the usual cause: a list item one space off, a tab character, or a missing space after a colon. The message under the tool gives the line and column where the parser gave up and what it expected, such as a missing comma in a flow list.
Related conversions
To go back, use JSON to YAML. To check or pretty-print the resulting JSON further, open it in the JSON formatter.