YAML Tools
YAML Formatter
Turn compact or uneven YAML into consistently indented text. Choose two or four spaces, check the parsed result, and download a readable copy without uploading your file.
✓ Every tool runs in your browser. We do not upload your input or output.
Keyboard shortcuts
Ctrl/⌘ + Enter: process
Ctrl/⌘ + Shift + F: full screen
Esc: exit full screen
Ctrl/⌘ + F in editor: search
How to use
- Paste one YAML document, upload a .yaml or .yml file, or choose Load sample.
- Select two or four spaces from the Indentation control. YAML indentation uses spaces, not tabs.
- Review the output and correct any error highlighted by line and column.
- Copy or download the formatted YAML after checking the values.
Examples
Expand a compact service map
Nested mappings and lists become easier to scan without changing their data values.
service: {name: api, ports: [80, 443]}service:
name: api
ports:
- 80
- 443Use four-space indentation
The indentation control changes the space width for each nested level.
profile: {city: İstanbul}profile:
city: İstanbulMake configuration easier to review
YAML is pleasant to write when a file is small, but a dense inline mapping can hide the boundary between fields. Consistent indentation makes a pull request easier to review and helps you spot a value nested under the wrong section. Paste a service configuration, a test fixture, or a small data export to see its parsed structure written in a predictable style.
The formatter reads one document and serializes its values with the selected indentation width. It keeps the order of mapping entries from the parsed document and writes sequences on separate lines. The output is useful for inspection or as a clean starting point for edits. If you need to preserve comments, exact quote choices, or the location of an anchor, keep the original file and make those edits in a source editor instead.
Check meaning after formatting
YAML scalars can look similar while representing different values. A quoted "false" is text, while an unquoted false is a boolean. The formatter uses a JSON-compatible YAML schema and writes values so they can be parsed back with the same meaning. Custom tags and non-finite numbers are outside this tool’s supported data model. An error message points to the parser location for ordinary syntax mistakes, such as a broken list or misplaced indent.
Your content is processed locally in a Web Worker. Large inputs wait for an explicit Process action, keeping the editor usable. The editor, output, and page have separate scroll areas, so formatting a long file does not stretch the page.
Frequently asked questions
Will formatting preserve comments?
No. The formatter parses YAML data and writes it again, so comments and original quote choices are not retained.
Will anchors and aliases remain?
The formatter expands supported aliases into their data values. Circular aliases are rejected.
Why are tabs not offered for indentation?
YAML requires spaces for indentation. The formatter offers two or four spaces to keep the output valid.
Can it repair invalid YAML?
No. It needs a valid document before it can format. Parsing errors include a line and column when available.
Is the formatted output the whole document?
Yes. The preview may be shortened for very large output, but Copy and Download use the full generated text.