YAML Formatter
Re-indent YAML consistently, sort keys if you like, and tidy lists. Anchors are expanded and comments are not kept. Everything runs in your browser, so your configs stay private.
- No daily cap
- Runs in your browser
- 2 or 4 space indent
- Sort keys A to Z
- Runs on your device. Files are never uploaded.
- Free and unlimited. No sign-up, no watermark.
YAML formatter in three steps
No account, no email, no waiting for an upload.
- STEP 01
Bring in your YAML
Use .yaml, .yml or .txt files.
- STEP 02
Choose the style
Pick 2 or 4 spaces, turn on key sorting if you want it, and choose block lists or short inline lists.
- STEP 03
Copy or download the result
The note reports the number of documents, and warns when comments were removed.
What YAML formatter does, and what it doesn't
We'd rather tell you up front than surprise you after the download.
What you get
- Consistent indentationMixed indents are replaced by 2 or 4 spaces throughout.
- Optional key sortingSort every map A to Z so files diff cleanly.
- Inline short listsWrite lists and maps below the top level as [a, b] and {x: 1} for a compact look, or keep one item per line.
- Multi-document filesEach document is formatted and the --- separators are kept.
- No line foldingLong strings stay on one line, so values are never wrapped unexpectedly.
Good to know
- Comments are not keptThe formatter reads the data and writes it back, so comments are lost. The result tells you when it detects any.
- Anchors become full copiesAliases (*name) are expanded, which makes some files longer.
- Quoting may changeStrings are re-quoted only where needed. Check the output when your parser is sensitive to quoting.
Your data never leave your device
The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.
Typical online tool upload
Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.
Mediaextractr no upload
The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.
When people use YAML formatter
Normalize CI or Compose files
Keep indentation uniform across a repo.
Repair messy indents
Fix a file edited by several people.
Prepare configs for review
Sort keys for stable diffs.
Understand a YAML file
Expanded, consistent YAML is easier to read.
Mediaextractr vs typical upload tools
| MediaextractrPrivate | Typical upload tools | |
|---|---|---|
| Your file is uploaded | Never | Yes |
| Sign-up needed | No | Often, after a few files |
| Daily file limit | None | Often 1–2 free files |
| Watermark | Never | Sometimes |
| Wait for upload & download | No | Yes |
| Speed on very large files | Depends on your device | Depends on their servers |
What the formatter does
The YAML is parsed into data and written out again in a standard style. That means the layout is consistent, but only the data survives: comments, blank lines and the exact quoting you typed do not.
For files where comments matter, use this tool on a copy to compare structure, not to overwrite your source.
Choosing options: YAML formatter
Some choices help in specific cases:
- 2 spaces is the usual choice for YAML. Use 4 only if your team does.
- Sort keys when you want predictable diffs, but remember that some tools care about key order.
- Inline short lists make tag-like lists compact.
- Validate first with the YAML validator.
- Convert to JSON with YAML to JSON to see the exact data.
Formatting without losing intent
Because comments are not preserved, use this tool on files where structure matters more than notes, or copy comments back by hand afterwards. A good habit is to format a copy, compare it with the original using the text diff checker, and only then replace the file.
Questions, answered
How do I format YAML online?
Paste the YAML, choose an indent and copy the result.
Does it keep my comments?
No. Comments are not part of the data, so they are removed. The tool tells you if it noticed any.
Are files with passwords sent anywhere when formatted?
No. The YAML is parsed and re-written by code in this tab. Passwords and hostnames in it stay local.
Can it sort keys?
Yes. Turn on 'Sort keys A to Z'.
What happens to anchors and aliases?
They are expanded into full copies.
Does the formatter run on phones?
Yes. Paste, choose the indent and copy the tidy YAML in a current mobile browser.