All free tools
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

How the YAML to JSON converter works

This YAML to JSON converter turns YAML into clean, formatted JSON instantly, as you type. Paste YAML on the left and the formatted JSON appears on the right — no buttons, no waiting, no uploads. Flip the direction and it converts JSON back into YAML just as fast. Because YAML is a superset of JSON, the YAML-to-JSON direction is nearly always lossless; going the other way, comments are dropped permanently since JSON has no comments. Invalid input is flagged immediately with the exact line that’s broken, so you’re never guessing where a config file went wrong. The page also documents exactly what changes in the conversion — how mappings, sequences, booleans, timestamps, comments, and anchors are handled in each direction — and collects the YAML gotchas most likely to break a config.

Details that save debugging time

The converter follows YAML 1.2 for booleans — only true and false count, so values like yes, no, on, and off stay as strings instead of silently becoming booleans the way older parsers treated them. YAML timestamps serialize to ISO 8601 strings, anchors and aliases are expanded inline, and multi-document YAML files are supported. Everything runs locally in your browser, so API keys and secrets in your configs never travel anywhere.

Need another in-browser utility? The image compressor shrinks images to an exact KB target the same way this page converts configs — no uploads, no sign-up. Find both among all free tools.

Frequently asked questions

How does the YAML to JSON converter work?

Paste or type YAML into the left pane and formatted JSON appears on the right instantly, as you type. A direction toggle flips the conversion so JSON becomes YAML. The whole thing runs locally in your browser — nothing is uploaded, stored, or sent to a server, which makes it safe for configs containing secrets.

How do I find which line has the error?

When your input is invalid, the converter flags it immediately and names the exact line that is broken. Fix that line and the output updates live — there is no separate validate button or error log to dig through at all.

Does it validate my input as well as convert it?

Yes. Conversion only succeeds on valid input, so a successful result is itself a validation pass — and failures point at the exact broken line. Multi-document YAML files are supported, and the YAML 1.2 boolean rules keep values like “on” and “yes” from silently becoming booleans.

What happens to comments and anchors when I convert?

Comments are dropped, because JSON has no comment syntax — converting JSON back to YAML will not bring them back, so keep your original if the comments matter. Anchors and aliases are expanded inline, since JSON has no reference mechanism; aliased values are simply duplicated in the output.

Advertisement