YAML Formatter
Format, validate and minify YAML — 2- or 4-space indent, flow-style minify, line errors.
Last updated:
Tool
No YAML yet
Indent
No YAML yet
Your files never leave your device - processing happens in your browser.
Related tools: YAML to JSON Converter · JSON to YAML Converter · XML Formatter
A YAML formatter is a tool that takes raw YAML — the plain-text format behind app configs, CI pipelines and data files — and reprints it with consistent indentation so humans can read it; it can also validate YAML and pinpoint syntax errors. FreeToolsKit's formatter formats with 2 or 4 spaces, minifies to compact flow style, and handles files with several documents. Your YAML is parsed in your browser and never sent to a server.
How do you format or validate YAML?
- Paste your YAML into the box — or press Sample to load a bookstore catalogue example.
- Choose 2 spaces or 4 spaces for the indent, then press Format.
- If the YAML is invalid, read the error message — it names the line and column of the problem.
- Use Minify when you need the compact flow-style version, for example for a config value.
- Press Copy to take the result, Download .yaml to save it, or Reset to start again.
What is the YAML Formatter used for?
- Reading a cramped one-line YAML config by spreading it into indented lines.
- Hunting a syntax error in a GitHub Actions workflow or docker-compose file after a parser rejects it.
- Minifying YAML before pasting it into a config value or an environment variable.
- Tidying a Kubernetes manifest before editing it by hand.
- Checking a multi-document YAML file's structure before applying it.
Frequently asked questions
Is the YAML formatter free?
Yes. The tool is completely free with no sign-up and no usage cap. Format and validate as much YAML as you like, as often as you like.
Is my YAML uploaded anywhere?
No. Parsing happens in your browser tab with the js-yaml parser. Configs and files containing tokens or personal data stay on your device — nothing is uploaded or logged.
Does formatting keep comments?
No. Formatting parses the YAML into data and prints it again, so comments are dropped, anchors resolve to plain values, and dates are reprinted as ISO timestamps. The values themselves stay the same — only the layout changes. Keep a copy of the original if the comments matter.
What does the validator check?
It checks the text against the YAML rules: consistent indentation, colons after keys, matched brackets and quotes, and no duplicate keys. Tabs are never allowed for indentation — the parser rejects them. The first problem found is reported with its line and column.
What are the limits?
YAML is limited to 100,000 characters — longer input shows an error and the Format, Minify and Validate buttons stay disabled until it is shortened. With an empty box the tool shows “No YAML yet” and the same buttons stay disabled. Files with several documents separated by --- are supported, and you can also upload a .yaml or .yml file instead of pasting.
Related tools
- YAML to JSON ConverterConvert YAML to JSON in your browser — paste or upload .yaml, copy or download.
- JSON to YAML ConverterConvert JSON to YAML — paste or upload .json, pick an indent, copy or download .yaml.
- XML FormatterFormat, validate and minify XML — 2, 4 or tab indent, with line-and-column errors.
- JSON FormatterValidate, pretty-print and minify JSON with precise error pinpointing.
- CSS FormatterFormat, validate and minify CSS — 2, 4 or tab indent, with line-and-column errors.
- SQL FormatterFormat SQL for MySQL, PostgreSQL, SQLite and more — dialect, indent and keyword case.
Last updated:
- Free forever
- Files stay on your device
- No sign-up