YAML to JSON

Convert simple YAML input into JSON for APIs, scripts, configuration processing and data interchange.

Ad space — place your AdSense unit here after approval.
Your result will appear here.

YAML to JSON online

Convert simple YAML — key: value pairs with indented nesting — into JSON, for the everyday config snippets that live between full YAML documents.

Quick answer: Use simple YAML input when another tool or API requires JSON output.

How to use this tool

  1. Paste YAML built from key: value lines and indentation-nested blocks.
  2. Click Run Tool. Lines using lists, anchors, flow style or block scalars are rejected with an error naming the line, rather than silently mis-converted.
  3. Copy the JSON from the result panel.

Common uses

Turning small config fragments into JSON for a script, checking how a nested settings block is structured, and prototyping payloads from YAML examples found in documentation.

How it works

This is a deliberately small parser for a deliberately small subset: mappings only. Each line is key: value, nesting is expressed by indentation, and # comment lines and blank lines are ignored. Values are typed: true/false become booleans, null becomes null, numeric text becomes a number, quoted text is unquoted, and everything else stays a string. Anything outside the subset — a line starting with - , an anchor, {flow} style, a | or > block scalar — stops the conversion with an error pointing at the offending line.

Worked example

Paste:

name: Ana
address:
  city: Berlin
  zip: "10115"
active: true

and the result is:

{ "name": "Ana", "address": { "city": "Berlin", "zip": "10115" }, "active": true }

The quoted zip stays a string; unquoted, it would have become the number 10115.

Privacy and browser processing

Your YAML is parsed in your browser with JavaScript — it is never uploaded or stored.

Frequently asked questions

Why did my YAML fail with "Unsupported YAML"?

The converter supports mappings and nesting only — no lists, anchors, multi-line strings or flow collections. The error names the first line it cannot handle; convert that construct to plain key: value form, or use a full YAML library for complex documents.

My indentation uses tabs. Does that matter?

Yes — nesting is measured by leading-space count, and tabs confuse it. Indent with spaces, consistently, and the nesting resolves as expected.

What happens with a repeated key?

The later line wins and silently replaces the earlier value, matching how JSON objects behave. Rename one of them if both are needed.

Are numbers always converted to numbers?

Any value that parses as a number does, including things like 1e3. Wrap the value in quotes when it is really an identifier or code that merely looks numeric.

Is my YAML uploaded?

No. The parsing runs in your browser; nothing leaves the page.

Related tools

Ad space