YAML to JSON Converter

Convert YAML config into formatted JSON.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Convert YAML to JSON in your browser

Paste YAML and get clean, pretty-printed JSON. This is handy when a tool wants JSON but your config — a Compose file, a CI workflow, an app settings file — is written in YAML, or when you simply want to inspect the exact data structure your YAML produces.

How it works

The converter is a small recursive-descent parser over indentation levels. It first tokenizes the input: tabs are expanded to two spaces, blank lines and # comment lines are dropped, and each remaining line is recorded with its indent depth and trimmed content. It then walks those lines:

  • A run of lines that begin with - at the same indent becomes a JSON array (block sequence).
  • Lines of the form key: value at the same indent become a JSON object (mapping).
  • A key with an empty value followed by more-indented lines recurses into a nested block.

Scalars are typed: whole numbers become JSON numbers, decimals become floats, true/false become booleans, null and ~ become null, an inline [a, b] becomes an array, and quoted values stay strings. The result is pretty-printed with 2-space JSON indentation.

Example

Input:

name: Gera Tools
private: true
tools: 6
tags:
  - fast
  - free

Output:

{
  "name": "Gera Tools",
  "private": true,
  "tools": 6,
  "tags": ["fast", "free"]
}
YAML tokenJSON result
true / falseboolean
42number 42
~ or nullnull
"42"string "42"

Everything runs locally in your browser — your configuration and secrets are never uploaded or stored, so it is safe for sensitive files.

Ad placeholder (rectangle)