JSON to YAML
Parse a JSON document and re-serialise it as YAML. Invalid JSON is reported with a hint. Everything runs locally — nothing is uploaded.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
What it produces
Paste a JSON document and the tool parses it, then re-serialises it as YAML with the indent width you choose — 2 spaces by default, or 4 for teams whose linters insist on wider nesting. The result is a standard YAML block that keeps the original structure: objects become mappings, arrays become sequences, and quoted strings are emitted where YAML would otherwise misread them.
A typical use
This is the quick path when you have a JSON payload — a Kubernetes manifest stub, a CI job, an app config copied out of a request — and the file you need to edit by hand is YAML. Converting once gives you properly indented YAML to paste into a repository, instead of re-indenting by eye and introducing a tab-versus-space bug.
What the indent option changes
The indent option only affects whitespace: it sets how many spaces each nesting level is stepped in. It never changes keys, values or ordering, so the two settings always describe the same document and you can match whatever the surrounding file already uses.
Strict JSON only, and privacy
The input must be valid JSON — comments, trailing commas and unquoted keys are rejected with a friendly error rather than guessed at, so a YAML-to-JSON round trip is a separate step. Everything happens in your browser using a bundled YAML library, with no upload and no network request, so it works fully offline.
Questions
What happens with invalid JSON?
The tool throws a friendly error with the parser message so you can find the syntax problem.
Are comments supported?
No. JSON has no comments, so the input must be strict JSON. Use YAML to JSON for the reverse direction.
Does the indent setting change the data?
No. Indent only controls blank space; keys, values, ordering and types are identical whether you pick 2 or 4 spaces.
Related tools
See categoryYAML to JSON
Convert YAML to JSON locally, with indent choice and optional key sorting.
JSON to CSV
Turn a JSON array of objects into CSV, with delimiter, header, and flatten options.
CSV to JSON
Parse CSV (RFC 4180) into a JSON array, with delimiter sniffing and type inference.
.env <-> JSON
Parse a .env file into JSON, or turn a JSON object into .env text. Runs entirely on your device.