This free tool converts YAML to JSON right in your browser and can also convert JSON to YAML. Typical inputs are Kubernetes manifests, Docker Compose files, CI pipelines and app configurations. If the input is invalid, the tool reports the line and column and marks the faulty spot. Input and output are linked line by line. The tool also points out values that YAML 1.1 and YAML 1.2 read differently. Your data never leaves the browser.
Paste your YAML into the left box or drop a .yaml or .json file onto it. The JSON appears instantly on the right. You can copy it or download it as a file, either formatted or compact.
No. The conversion runs entirely in your browser, with no server, no storage and no cookie. This also matters for configuration files that contain internal details.
The tool shows the line and column, marks the spot and can jump straight to it. Common causes are tabs instead of spaces in indentation, misaligned indentation and a “: ” inside an unquoted value. Unclosed quotes or brackets are another frequent reason.
In YAML 1.1, yes, no, on and off are booleans. As a result, the country code NO for Norway becomes false. YAML 1.2 only knows true and false, but many tools such as PyYAML still read 1.1. The safe fix is to quote such values.
Choose the version your target tool reads. PyYAML, Ruby and many Kubernetes tools follow YAML 1.1, while newer libraries tend to use 1.2. The “Traps” list shows every place where the two readings differ.
Yes. JSON has no references, so the tool writes aliases (*name) out in full. The merge key <<, common in Docker Compose, can be switched off in the settings. Alias bombs (Billion Laughs) are stopped before they can expand.
Yes, with the direction switch. Texts that YAML would otherwise read as a number, boolean, null or date are quoted. The tool then reads its own output back in YAML 1.1 and 1.2 and checks that the same data comes out.
In YAML 1.1 a leading zero means octal, so 0755 becomes 493. In YAML 1.2 the number is decimal and the leading zero is lost: 01234 becomes 1234. Write postcodes and file permissions in quotes.
The tool handles up to 5 MB of text and up to 100 nesting levels. The output view shows the first 4000 lines. Copy and Download always give the full text.
YAML and JSON describe the same basic structures: objects (mappings), lists and plain values such as strings, numbers, booleans and null. JSON is strict. Strings and keys need double quotes, comments do not exist and trailing commas are forbidden. YAML relies on indentation instead and allows comments, multi-line block texts, and anchors (&name) and aliases (*name) for reusing parts of a document. That is why YAML is common in configuration such as Kubernetes, Docker Compose and CI pipelines, while APIs and many programs expect JSON. JSON is almost a subset of YAML, so a YAML parser can usually read JSON directly.
The YAML version is a well-known source of conversion errors. YAML 1.1 reads yes, no, on and off as booleans. This quirk is called the Norway problem, because the country code NO turns into false. YAML 1.1 also treats numbers with a leading zero as octal (0755 becomes 493) and times like 12:30 as sexagesimal numbers (750). Version 1.2, published in 2009, simplifies these rules with its core schema, where only true, false and null are special. Many widely used tools, such as PyYAML, still read 1.1, however. Two pitfalls apply across versions: decimals like 1.10 become the number 1.1, and very large integers above 2^53−1 are silently rounded by JavaScript and many JSON readers. The tool lists such spots in its “Traps” panel.
JSON has no anchors or aliases, so the tool writes them out. The merge key << merges mappings. It is not part of the YAML 1.2 core, but it is widespread in Docker Compose. Because aliases can inflate a document exponentially (the Billion Laughs attack), the tool limits the node count and stops before expansion.
The parser is a custom implementation. It follows the YAML 1.2.2 specification and the YAML 1.1 type definitions and was tested against PyYAML. Unsupported constructs such as complex keys or %TAG directives are reported in plain words instead of being misread. Dates stay text, since JSON has no date type. In the opposite direction, the tool quotes strings that would otherwise be misread. It then checks the generated YAML by reading it back in both versions.
YAML to JSON and JSON to YAML — in the browser, with its own parser. Hovering or clicking a line lights up the matching spot on the other side (also for alias resolution and merge keys: it then points at the place that supplies the value). Several documents (---) become a list or one line per document. Keyboard: Alt+K copies the output · in the input the caret shows the matching spot in the output · in the output ↑ ↓ change line, Enter jumps to the input.
YAML 1.1 reads yes, no, on, off as booleans — the country code NO becomes false. YAML 1.2 (2009) knows only true and false, but many tools (PyYAML, Kubernetes libraries, older Ruby/Psych) still read 1.1. The setting “YAML version” shows both readings; the “Traps” box names every place where they differ. Safe in both versions: write such texts in quotes ("NO").
Leading zeros: 0755 is octal in 1.1 (493), decimal 755 in 1.2 — the zero is lost (postcode 01234 → 1234). 12:30 is the number 750 in 1.1 (sexagesimal), text in 1.2. 1.10 becomes the number 1.1 — write versions as text. 1_000 is a number only in 1.1. Numbers above 2^53−1 keep all digits here; JavaScript would round them. Floats are written as 3.0 so the type stays visible; JSON has no .inf and .nan.
&name remembers a node, *name inserts it again; JSON has no such thing, so it is written out. << * is read as merging mappings (common in Docker Compose) — explicitly not a YAML 1.2 core feature, hence switchable; own keys override merged ones, in a list the earlier entry wins. Self references (&a [*a]) are reported. A safeguard against alias bombs (Billion Laughs) is built in: if aliases inflate a document disproportionately, processing stops before anything is written out.
| keeps line breaks, > folds single breaks into spaces (blank line = break, more indented lines stay). After it: - strips the last break, + keeps all trailing blank lines, neither keeps exactly one. A digit (|2) fixes the indentation when the first line starts with spaces. The parser follows the reference implementation (PyYAML) line by line here — tested against it.
Texts are written without quotes only if they stay text in YAML 1.1 and 1.2 — everything else (no, 12:30, 0755, 1e3, 2024-01-05, empty, containing “: ” or “ #” …) is quoted and listed in the “Protected values” box. Multi-line texts become a | block. Afterwards the tool reads its own output back in both versions and compares it with the input; a message appears only if they differ. If the input is not strict JSON but valid YAML (comments, trailing comma, 'single' quotes), it is read as YAML — JSON is (almost) a subset of YAML.
Up to 5 MB of text, nesting up to 100 levels, up to 1 million nodes after alias resolution (alias bombs earlier). The output shows the first 4000 lines; Copy and Download give everything. Nothing leaves the browser; no server, no storage, no cookie. Checked against the YAML specification and PyYAML.
Die Werkzeuge auf dieser Website werden als kostenloses Hobbyangebot bereitgestellt und dienen ausschließlich zur Information und privaten Nutzung. Für die Richtigkeit, Vollständigkeit oder Eignung der Ergebnisse für einen bestimmten Zweck wird keine Gewähr übernommen. Vor Verwendung der Ergebnisse — insbesondere bei finanziellen, rechtlichen oder sicherheitsrelevanten Entscheidungen — sind diese eigenverantwortlich zu prüfen. Eine Haftung für Schäden aus der Nutzung ist ausgeschlossen, soweit dies gesetzlich zulässig ist.