YAML Formatter & Validator
Format, validate and pretty-print YAML at any indent from 1 to 10 spaces, with optional key sorting and line-numbered errors. Comments kept, output stays YAML.
name: MakerBox version: 3 nested: count: 3 active: true tags: - free - private - fast list: - one - two
🔒 Runs in your browser — nothing is uploaded.
Format and validate in one step
Paste YAML and get it back clean: consistent indentation at any width from 1 to 10 spaces (2 by default), flow-style collections expanded into readable block style, and stray whitespace removed. A Sort keys tick puts every mapping into alphabetical order, which makes two versions of the same config comparable line by line. Long values are never line-wrapped, so URLs and tokens stay on a single line. Parsing is handled by the well-tested yaml engine, which keeps your comments, anchors and aliases in place — a formatted config file still reads as the one you wrote — and understands nested mappings, sequences and multiline scalars correctly rather than through a fragile hand-written parser. When the input has a syntax error, the exact reason and the line number are shown so you can fix it quickly.
A formatter, not a converter
This tool keeps the output as YAML — it tidies and validates your document while leaving it as YAML, which is what you want for config files, CI pipelines, Kubernetes manifests and docker-compose files. It also catches the mistakes that stop a YAML file from loading: duplicate keys, a tab used for indentation, or a wrong nesting level. If you instead need to turn YAML into JSON, use the separate YAML to JSON converter. Everything runs locally in your browser, so even a config file full of secrets never leaves your device.
Frequently asked questions
Does this tool convert YAML to JSON?
No. It keeps the output as YAML, re-indenting and normalizing your document while it stays YAML. If you need JSON instead, use the separate YAML to JSON converter.
What happens if my YAML is invalid?
Instead of formatted output you get the parser error message and the line number where parsing failed — a duplicate key, a tab used for indentation, or a bad nesting level — so you can find and fix it fast.
Is my YAML uploaded anywhere?
No. Parsing and formatting run entirely in your browser with JavaScript, and nothing you paste is ever sent anywhere. It is not kept either, unless you ask: tick “Remember what I typed on this device” and the text is saved in this browser alone, so a half-fixed config is still there tomorrow. Untick it and what was saved is erased. The tick is off to begin with, so a config file full of secrets leaves no trace; your indent width and Sort keys setting are remembered on this device either way.