Home » Developer Tools » YAML Minifier
Paste YAML and get a compact flow style version in seconds, right in your browser.
Last updated 13 November 2026
Need the readable version instead? Try the YAML Beautifier to expand YAML back to block style.
Your code never leaves your browser. Everything runs locally on your device.
YAML files are easy to read but take up space, because indentation is significant and block style spreads every value over many lines. The YAML Minifier rewrites your YAML in compact flow style, so nested maps and lists sit on far fewer lines.
Minifying YAML is different from minifying JSON: whitespace cannot simply be stripped, because indentation carries meaning. Flow style is the safe compact form, and comments are dropped when the file is parsed. Everything runs in your browser, so your files are never uploaded to a server.
Short YAML is handy wherever config files are pasted into a form, a chat message or a ticket. A Kubernetes manifest, a Docker Compose file, a Helm values file, a GitHub Actions workflow, an Ansible playbook and an OpenAPI document are all YAML, and all of them get easier to share when the block style is squeezed into flow style. Paste the file, copy the compact result, and paste it back where it belongs.
The tool is built for that job, not for editing. It does not change the structure of your file: maps stay maps, lists stay lists, and the order of the keys stays the same. What it changes is the shape, from many indented lines to a few flow style lines, so the file takes less room on the page and in the message.
Minifying is honest about what it keeps and what it drops. Comments are dropped when the file is parsed, and blank lines go with them. Multi line literal blocks become double quoted strings with line breaks written as escapes, so the value stays the same but the text is harder to read, and a file full of long strings can even grow instead of shrinking. The size bar shows the change honestly, including a plus sign when the result is larger.
Anchors and aliases are kept as shared references, but they may be renamed in the output, and merge keys are expanded into the mapping that uses them, so a diff against the original will not be clean. Large integers, octal file modes and date only values stay exactly as written. A full timestamp with a time part still becomes a UTC timestamp, and a mapping key that looks like a large number is kept as a quoted string, because YAML tools store mapping keys as text. If you want the block shape kept, use Clean Block mode instead: it strips comments and blank lines and leaves everything else, including literal blocks, exactly as written.
Yes, it is completely free with no sign up.
YAML cannot be shrunk by stripping whitespace, because indentation carries meaning. This tool rewrites your YAML in compact flow style, which is the safe way to make YAML smaller.
Mostly. The compact form carries the same nesting and list order, and large numbers, octal modes and dates stay exactly as written. But a few things change: multi line literal blocks become quoted strings, comments are dropped, anchors may be renamed and merge keys are expanded, so a diff against the original will not be clean. Check the result before you deploy it.
Comments are dropped when YAML is parsed. Anchors and aliases are kept as shared references, but they may be renamed in the output, so do not rely on the original anchor names. Merge keys are expanded into the mapping that uses them.
No. All minifying happens in your browser on your own device, so your files never leave your computer.
The tool shows a clear error message and keeps your input untouched, so you can fix the problem and try again.
That happens with string heavy YAML. Multi line literal blocks become double quoted strings with line breaks written as escapes, so the value stays the same but the text gets longer. The size bar shows the change honestly, including a plus sign when the result is larger. Clean Block mode is the better choice for that kind of file: it strips comments and blank lines and keeps the block style.
Yes. A 19 digit number such as 1234567890123456789 stays exactly as written, and so does 9007199254740993. The tool keeps big integers as text instead of passing them through a JavaScript number, which would round them.
They stay as written. A date such as 2026-11-14 stays 2026-11-14, and an octal file mode such as 0777 stays 0777. A full timestamp with a time part still becomes a UTC timestamp, and a mapping key that looks like a large number is kept as a quoted string.
Yes. Input over 1 MB shows a clear error and is not minified, and YAML nested more than 100 levels deep is refused the same way. The limits are there because the work runs in your browser, and a very large or very deep file can use a lot of memory. Your input is kept untouched when a limit is hit.
This tool makes YAML compact. The YAML Beautifier does the opposite: it expands YAML back to readable block style with indentation. Use the minifier to share or paste a short version, and the beautifier to read a compact file again.
If you need JSON instead, try the JSON Formatter to format and validate JSON data.