Category: Developer tools

YAML Formatter

System ideaMissing a tool?

Format, re-indent and validate YAML in your browser

Re-indent YAML consistently, optionally sort mapping keys alphabetically, and catch syntax errors as you type. Parsed and rewritten entirely in your browser.

Formatted YAML
The result will appear here.

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

YAML is sensitive to whitespace, so a file that's hand-edited or copied between tools often ends up with inconsistent indentation. This tool parses the document and rewrites it with a chosen indent width, catching any syntax error along the way and reporting where it happened — useful for config files, CI definitions and deployment manifests.

How to use it

  1. Paste your YAML into the input.
  2. Choose 2- or 4-space indentation, and decide whether to sort keys alphabetically.
  3. Copy the reformatted YAML, or read the reported error if the document doesn't parse.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

Does this convert YAML to JSON?
No. It parses the YAML you paste and rewrites it as YAML at the indent width you chose. The output stays YAML; no other format is produced.
Will sorting keys change what the file means?
Sorting is optional and only changes the order in which mapping keys appear in the output — the keys and their values are the same ones you pasted. Leave it off if you want the original ordering preserved, for example to keep a diff readable.
Does it support multiple documents in one file?
The described behaviour is parsing the document you paste and rewriting it, so multi-document streams are outside what this tool claims to handle. Paste one document at a time, and use the reported error location if something doesn't parse.
Is my input, file, or result uploaded?
No. Inputs, files, settings, and results stay in the browser and are not uploaded to LocalTools. The YAML you paste is parsed and rewritten on your own device.
What does this tool not support?
There is no format conversion, no accounts or cloud history, no server-side processing and no batch runs. It parses pasted YAML, rewrites it at the chosen indent with optional key sorting, and reports where a syntax error occurred.