YAML Beautifier/Validator
Validate YAML and reformat it into clean block style with 2-space indentation; errors show line and column. Runs locally via WebAssembly.
Your inputs and files stay in your browser
YAML Input
Paste YAML here to reformat it or check it for syntax errors.
In the editor, Tab indents. Press Esc, then Tab to move focus out.
Formatted YAML or the validation result appears here.
On this page
Check a YAML file for syntax errors and rewrite it in a consistent block style. Parsing and formatting run in your browser in a small Rust library compiled to WebAssembly, loaded only when you first click Format or Validate.
Detailed Functionality
Validate only parses the input and answers “YAML is valid” or shows the first error with its line and column, e.g. mapping values are not allowed in this context at line 2 column 7. Format parses and re-emits every document: mappings and lists in block style with two-space indentation, inline collections such as [80, 443] or {host: localhost} expanded into lines, and each document starting with ---. Files with several documents separated by --- are supported.
Formatting rewrites the data, not the text, so some things are normalized: comments are removed, an empty value becomes ~, and words that YAML 1.1 tools read as booleans (yes, no, on, off) are quoted, e.g. flag: "yes". Key order is preserved. When you only need a syntax check and want to keep the file exactly as it is, use Validate.
The input editor highlights YAML and folds nested blocks; the result appears in a read-only output editor. Paste inserts text from the clipboard and Copy copies the output. Nothing you enter is stored or uploaded.
Practical Examples
Inline lists to block style: ports: [80, 443] is formatted as ports: followed by the lines - 80 and - 443.
Find an indentation error: name: demo followed by an indented port: 80 fails with “YAML is invalid: mapping values are not allowed in this context at line 2 column 7”.
Several documents: a: 1, ---, b: 2 stays two documents — the output is ---, a: 1, ---, b: 2.
Normalized values: flag: yes and an empty empty: become flag: "yes" and empty: ~.
How to Use This Tool
Add your YAML
Paste it into the YAML Input editor or click Paste to insert the clipboard contents.
Check the syntax
Click Validate. The badge shows “YAML is valid”, or an error with the line and column appears above the editors.
Format
Click Format (or press Ctrl+Enter / Cmd+Enter in the input) to get the normalized YAML in Output.
Copy the result
Click Copy to put the formatted YAML on the clipboard.
Tips and Best Practices
- Format drops comments — keep the original file, or use only Validate for files with important comments.
- YAML does not allow tabs for indentation; the error position points to the offending line.
- Line and column numbers start at 1, matching what most editors show.
- Before committing Kubernetes, Compose or CI files, check that quoted values such as
"yes"are what your tool expects. - The WebAssembly module is downloaded on the first Format or Validate; after that the page also works offline.
- In the input editor Tab inserts indentation; press Esc, then Tab to move focus out.