All free tools Aizen Labs
Advertisement

Developer tools

YAML to JSON Converter

Paste YAML on the left and get clean, formatted JSON on the right — instantly, as you type. Flip the direction to turn JSON back into YAML. Invalid input is flagged with the exact line that's broken.

Free, no sign-up Runs 100% in your browser Your data is never uploaded
YAML INPUT
JSON OUTPUT
Your converted output appears here as you type.
Waiting for input

What changes in the conversion

YAML is a superset of JSON, so YAML → JSON is nearly always lossless. Going the other way, or writing YAML by hand, a few data types need care:

YAMLBecomes in JSONNotes
key: value"key": "value"Mapping keys become strings.
- item (list)[ "item" ]Sequences become arrays, order preserved.
count: 42"count": 42Integers and floats stay numeric.
enabled: true"enabled": truetrue/false, yes/no, on/off all parse as booleans in YAML 1.1 style parsers — this converter treats only true/false as booleans, matching YAML 1.2.
empty: null or ~"empty": nullA key with no value at all also becomes null.
when: 2026-10-20"when": "2026-10-20T00:00:00.000Z"YAML timestamps parse as dates and serialize to ISO 8601 strings in JSON.
# a comment— dropped —JSON has no comments. Converting JSON → YAML drops them permanently.
Anchors &a / aliases *aExpanded inlineJSON has no references, so aliased values are duplicated in the output.
Multi-document (---)Array of documentsMultiple YAML documents convert to a single JSON array.

YAML gotchas worth knowing

Most "my YAML won't parse" problems come down to one of these four.

Indentation is syntax

YAML structure is defined by spaces — never tabs — and siblings must line up exactly. One stray space silently changes the nesting.

server: host: localhost port: 8080 ← one space too many

The Norway problem

In YAML 1.1 parsers, unquoted NO, on, and y can be read as booleans — the country code NO famously becomes false. Quote values when in doubt.

country: "NO" ← quoted, stays a string

Colons and special characters

An unquoted value containing : (colon + space) or starting with characters like *, &, {, or # will break or misparse. Wrap it in quotes.

title: "Error: something failed"

Strings that look like numbers

version: 1.20 parses as the number 1.2, and 0123 may read as octal. Quote version numbers, ZIP codes, and IDs to keep them exact.

version: "1.20" ← not 1.2

Frequently asked questions

Is my data sent to a server?

No. The conversion runs entirely in your browser using the open-source js-yaml library — nothing you paste or upload leaves your device. You can verify this by loading the page and disconnecting from the internet; the converter keeps working.

Can I convert JSON back to YAML?

Yes — use the JSON → YAML toggle at the top of the tool. The YAML output uses block style (no flow braces), respects your indent setting, and can optionally sort keys alphabetically, which is handy for tidying Kubernetes manifests and CI configs.

Why did my conversion fail?

The status bar shows the parser's error message with the line and column where it gave up. The usual causes are tab characters instead of spaces, misaligned indentation, a missing space after a colon, or an unquoted string containing a colon. Fix that line and the output updates automatically.

Does it support multi-document YAML files?

Yes. Files with several documents separated by --- (common in Kubernetes) convert to a JSON array containing each document in order. A single document converts to a plain JSON object.

What happens to comments and anchors?

JSON has no syntax for either. Comments are dropped, and anchors/aliases are expanded so the aliased value appears in full at each place it was referenced. The data itself is preserved.

Is YAML a superset of JSON?

Yes — every valid JSON document is also valid YAML. That's why pasting JSON into the YAML input also works here, and why JSON → YAML is always lossless for data (though never for comments).

Copied
Advertisement