YAML Formatter
Clean up YAML indentation and fix syntax instantly
gpt-4o-mini
Your prompt will appear here…
Your beautifully formatted article will appear here once you generate.
No history yet
Your generations will appear here. Sign in to save them permanently.
Has a pipeline ever failed with an error pointing at a line that looks perfectly fine? Do you count spaces with your cursor to work out which block a key belongs to? YAML Formatter on EizTools cleans up indentation and spacing so the structure you meant is the structure that is actually there.
Short answer: YAML Formatter is a free EizTools tool that cleans up YAML indentation and fixes syntax problems instantly. Paste your config file and it returns consistent spacing with the nesting put right.
What is YAML Formatter?
YAML Formatter tidies configuration files where the whitespace has drifted. In YAML the indentation is the structure, so a key sitting two spaces too far left belongs to a different parent, and the file is still valid. It just does something else.
That is what makes YAML errors so frustrating. There is often no syntax error at all, only a file that describes something other than what you intended.
How Does YAML Formatter Work?
Paste the file into the prompt box, choose a model, switch Show Changes on, then press Generate. The formatted result appears in the output card in a code block, and can be copied or downloaded as TXT, Word or HTML.
Operation Focus set to Normalize is the right choice here, since the job is making the indentation consistent rather than restructuring anything. Output Style on Clean Text keeps the result as a plain file. Show Changes is the toggle to reach for when you want to know what moved, which on a config file matters more than the tidy version itself.
Example Inputs And Outputs
Input, where the second key has drifted out of its block:
service:
name: billing
port: 8080
replicas: 2
The port line is indented under name rather than under service. YAML will either reject that or read it as something you did not mean. Formatted output puts port back alongside name and replicas at the same level, and with Show Changes on you are told the line was moved rather than left to spot it.
| Control | Why it matters for YAML |
|---|---|
| Operation Focus set to Normalize | Makes spacing consistent without reshaping the document |
| Output Style set to Clean Text | Returns a plain file you can paste straight back |
| Show Changes | Reports which lines moved, which is the part you need to review |
| Intensity | Keep it low, since heavy reshaping is not wanted on a config file |
Avoid Never paste a file still containing real passwords, tokens or connection strings. Swap them for placeholders, format the structure, then restore the values in your own environment.
Tips For Working With YAML
- Use spaces, never tabs. Tabs are not valid for indentation in YAML and cause errors that look unrelated.
- Pick two spaces per level and keep it consistent throughout the file.
- Quote values that could be read as something else, such as version numbers and the words yes and no.
- Review what moved before committing, since a corrected indent changes the meaning of the config.
Consistent indentation
One spacing rule applied throughout, so blocks line up the way you intended.
Changes reported
With Show Changes on you learn which lines moved rather than diffing it yourself.
Tab problems caught
Tabs used for indentation are flagged and replaced with proper spaces.
You never register or pay to use anything on EizTools, and every tool carries options built for its own job. The AI model is selected on the page before each generation. When the formatted config still fails to load and the message is impenetrable, paste it into the Error Fixer.
Frequently Asked Questions
Can YAML Formatter fix a file that will not parse?
Often, yes, since most parse failures are indentation or tab problems. Review what it changed carefully, because a corrected indent alters which block a key belongs to and therefore what the config does.
Does it preserve my comments?
Comments should survive a formatting pass, unlike a conversion to JSON where they cannot. Check them in the output, since comments attached to moved lines can end up in a different place.
How many spaces should I indent by?
Two spaces is the common convention and stays readable even at depth. What matters far more is consistency, because mixing two and four space levels within one file is where most of the confusion starts.
Is it safe to paste a production config?
Only after removing the secrets. Replace every password, token and connection string with a placeholder first. The structure formats identically either way, so you lose nothing and nothing sensitive ever leaves your own systems.
YAML punishes small mistakes with silent wrong behaviour rather than loud errors, which is the harder failure to debug. Making the indentation consistent, and seeing exactly what moved, is what turns a mystery into a two line fix. Paste your config into YAML Formatter above with the secrets swapped out.