How to use
Use it in two ways: format YAML text, or generate VS Code formatter settings.
- Paste your YAML into the input.
- Select indentation (2 or 4 spaces) and toggles (tabs, trim,
---). - Click Format YAML to normalize indentation.
- Or pick a formatter and click Generate VS Code settings to get a
settings.jsonsnippet. - Click Copy Output to copy the result.
FAQ
Which VS Code extension should I use to format YAML?
Prettier is a common choice for consistent formatting across file types; Red Hat YAML is great for YAML support and schema validation. This page can generate a settings.json snippet for either.
Why does YAML formatting fail in VS Code?
Usually there’s no default formatter set for [yaml], or another extension is taking precedence. Set [yaml].editor.defaultFormatter and enable format on save.
Does this tool fully parse YAML?
No. It’s a fast indentation normalizer that keeps your line content and re-maps indentation levels; complex YAML edge cases may require a real formatter in VS Code.
Will it convert tabs to spaces?
Yes. Enable “Convert tabs to spaces” to replace tabs with your selected indent size, which helps avoid YAML indentation issues.
Can it add the YAML document start marker (---)?
Yes. Enable the option to insert --- if the first non-empty, non-comment line isn’t already --- or ....
Does it change key order or rewrite values?
No. It only adjusts indentation and whitespace (plus optional ---), so it won’t sort keys or change scalars.
Is my YAML sent to a server?
No. The formatter runs entirely in your browser and does not make network requests.