How the YAML to JSON converter works
The converter parses your YAML with js-yaml 4.1.1, the YAML library used by a large part of the JavaScript ecosystem, and writes the result with the browser's own JSON.stringify. It converts as you type. Choose 2 or 4 spaces or tabs for readable JSON, or Minified for the smallest output to paste into an API call or environment variable.
Because parsing happens in your browser, it is safe to paste Kubernetes manifests, CI pipelines, Docker Compose files or app configs that contain hostnames and internal settings. Nothing is sent to a server.
JSON is a subset of YAML 1.2, so any valid JSON is also valid YAML. The reverse is not true. Comments, anchors, multi-line strings and multiple documents have no JSON equivalent, so they are resolved or dropped during conversion.
YAML 1.2 surprises: yes, no, 0755 and version numbers
js-yaml 4 follows the YAML 1.2 core schema. Older YAML 1.1 parsers such as Python's PyYAML treat yes, no, on and off as booleans. In YAML 1.2 they are ordinary strings, and only true and false (also written True/TRUE and False/FALSE) are booleans: country: NO → {"country":"NO"}, enabled: yes → {"enabled":"yes"}, ok: True → {"ok":true}. This fixes the famous “Norway problem”, where the country code NO turned into false, but it means the same file can give different results in Python and JavaScript.
Leading zeros are not octal. In YAML 1.2 octal needs a 0o prefix: mode: 0755 → {"mode":755} but mode: 0o755 → {"mode":493}. In YAML 1.1, 0755 meant octal 493. File permissions and ZIP or PIN codes are where this bites.
Version numbers are floats. version: 3.10 → {"version":3.1}. The trailing zero is gone. Quote anything that only looks like a number: version: "3.10" → {"version":"3.10"}.
Dates become timestamps. js-yaml reads an unquoted date as a timestamp, which JSON writes in ISO format: released: 2026-10-20 → {"released":"2026-10-20T00:00:00.000Z"}. Quote it to keep the plain text.
Null has several spellings. a: ~ → {"a":null}, and an empty value such as b: is also null.
When you convert JSON back to YAML, strings that a YAML 1.1 parser would misread are quoted for safety. For example {"answer":"yes","zip":"012","n":12} becomes answer: 'yes', zip: '012', 'n': 12.
Error messages with line and column
When the YAML is invalid, the converter shows the problem, the line and column (counted from 1), and the surrounding lines with a marker under the exact spot. Click Go to line to jump there in the editor. For example, a mapping with the same key twice is rejected: “Line 3, column 1: duplicated mapping key”.
The most common errors are indentation that does not line up with the parent key, a tab used for indentation (YAML only allows spaces), a missing space after a colon (key:value is read as one string, not a key and value), and an unclosed quote or bracket. Values containing : or starting with *, &, !, % or @ need quotes, or they are read as something else or rejected.
Multiple documents, anchors and merge keys
A YAML file can hold several documents separated by ---, as Kubernetes manifests often do. A single JSON value cannot, so tick Multiple documents to get a JSON array with one item per document: name: web --- name: worker becomes [{"name":"web"},{"name":"worker"}]. Without the option you get a clear error telling you to tick it.
Anchors (&name), aliases (*name) and merge keys (<<) are expanded, because JSON has no references. Keys set directly in the mapping override merged ones: base: &base ⏎ retries: 2 ⏎ job: ⏎ <<: *base ⏎ retries: 5 becomes {"base":{"retries":2},"job":{"retries":5}}.
Tips for clean conversions
Quote values you need as strings: IDs with leading zeros, version numbers, phone numbers and anything like 1e3, which YAML reads as the number 1000.
Watch big integers. JavaScript numbers are exact only up to 253. The converter warns you when a larger integer would lose digits, and when .inf or .nan have to become null in JSON.
Validate before you commit. Pasting a config here is a quick way to catch indentation mistakes before a deploy fails. Need to search the result for a pattern? Try the regex tester. Documenting the config? Our Markdown to HTML converter turns your README into clean HTML.