YAML Formatter and Validator
Paste YAML to clean up the indentation, normalize the style and validate the syntax. Choose your indent, sort keys, and spot errors instantly.
How to format YAML
- Paste or type your YAML into the editor.
- Pick the indentation you want and toggle key sorting on or off.
- Copy the formatted YAML or download it as a .yaml file.
Examples
Normalize messy YAML
{ name: Ada, skills: [math, logic] }name: Ada skills: - math - logic
Frequently asked questions
Does this validate YAML too?
Yes. The YAML is parsed before it is reformatted, so any syntax error, such as bad indentation or a missing value, is reported with the parser's message.
Is my YAML uploaded anywhere?
No. Formatting and validation run entirely in your browser, so your YAML never leaves your device.
What does formatting actually change?
It rewrites the document in a consistent block style with even indentation, converts inline flow syntax to block form, and removes stray blank lines, without changing the underlying data.
Can I sort the keys?
Yes. Turn on key sorting to order mapping keys alphabetically at every level, which makes diffs and reviews easier to read.
What happens to comments and anchors?
Comments are dropped because they are not part of the parsed data. Anchors and aliases are resolved, so the output contains the fully expanded values.
Which indentation should I use?
Two spaces is the common default and works well for most files. Four spaces gives more visual separation for deeply nested structures.
Learn more
- Common YAML errors and how to fix them
Tabs, inconsistent indentation, missing colons and other YAML mistakes, with quick fixes that make your file valid again.
Related tools
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
YAML to JSON
Convert YAML to JSON online. Paste YAML and get clean, pretty-printed JSON with the indentation you choose. Runs entirely in your browser.
SQL Formatter
Format and beautify SQL online. Put clauses on their own lines, indent the column list and uppercase keywords. Fast and runs in your browser.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
Aspect Ratio Calculator
Calculate aspect ratios fast. Enter a ratio like 16:9 and one dimension to get the other, or enter width and height to simplify the ratio.
Base58 Encoder
Encode and decode Base58 online with the Bitcoin alphabet. Convert text to Base58 or back, UTF-8 safe, no confusing 0 O I l. Runs in your browser.