Skip to content

YAML Formatter

Normalise YAML formatting in your browser: consistent indentation, optional key sorting, and a documented parse error when something is off.

Paste YAML

Formatting

Formatted YAML

Paste YAML, then format.

The formatted YAML appears here.

Limit for uploaded files: 10 MB. Pasted text is not truncated by the tool — your browser’s memory is the ceiling.

Your file is never sent to a server. It is read and processed by your own browser, and the results are not stored.

How to use it

  1. Paste YAML, or choose a .yaml / .yml file.
  2. Choose indentation and whether to sort keys alphabetically.
  3. Format, then copy the result or download it.

Limits worth knowing

  • Single document only; multi-document files (---) are refused with their count.
  • Comments are not preserved because YAML comments are not part of the document tree.
  • Sorting keys changes the file’s key order — turn it off if order is significant.
  • Files above 10 MB are refused to keep the tab responsive.

Why YAML drift happens

YAML is written by hand and by machines. Mix tabs and spaces, indent a list item one space off, or leave a trailing colon, and a config file fails in ways that only surface at deploy time. Formatting first turns those into a parse error you can fix locally.

Re-dumping rather than token-shuffling guarantees the output is valid for the same parser that reads it back.

When to sort keys

Sorted keys make structural diffs stable across editors and generations of the same file. Leave it off when the document order carries meaning, such as an ordered list of steps expressed as a mapping.

Frequently asked questions

Does YAML Formatter upload my files to any server?

No. YAML Formatter runs in your browser, and the file is read there rather than sent to a server for processing. Our host still sees ordinary page-request metadata, which is described on the privacy page.

Is YAML Formatter free to use?

Yes, YAML Formatter is free, with no paid tier, no account, and no watermark added to your output. The limits are technical rather than commercial: file size, page count and supported formats are listed on this page.

What file formats and sizes are supported?

YAML Formatter supports .yaml, .yml, .txt files up to 10MB directly in your browser.

Does it change my data?

No. It re-dumps the parsed document, so semantics are preserved. Key order is kept unless you turn on sorting, and comments are dropped because they are not part of the parsed document.

Can it find YAML mistakes?

Yes — the same engine that formats reports the failure. If the file cannot be parsed, you get the parser’s message with line and column rather than a “fixed” file.

What does key sorting change?

Keys are sorted alphabetically at every level. That is cosmetic; use it when your repository diffs YAML heavily and you want stable ordering.

Is my file uploaded?

No. Formatting runs in this tab; the file is not sent anywhere.