📄

YAML Formatter

Format, validate and prettify YAML files.

Input
Formatted YAML

📖 What is YAML Formatter?

YAML Formatter validates YAML syntax and reformats it with consistent indentation. Paste messy or broken YAML and get properly formatted output with parse error details if the syntax is invalid. Use it to clean up Kubernetes manifests, Docker Compose files, CI/CD configs or any YAML file. Everything runs in your browser.

💡 Example

Input
name: Alice age: 30 roles: - admin - dev
Output
name: Alice age: 30 roles: - admin - dev

🛠️ Common Use Cases

  • Fixing indentation in Kubernetes YAML manifests
  • Validating Docker Compose file syntax
  • Formatting CI/CD pipeline configs (GitHub Actions, GitLab CI)
  • Cleaning up YAML config files for readability
  • Debugging YAML parse errors

📝 YAML Indentation Rules

  • Use spaces only — tabs are not allowed in YAML
  • Consistent indentation (2 or 4 spaces) throughout the document
  • Child elements must be indented further than their parent
  • List items (- item) are indented under their parent key

⚠️ Common Mistakes

  • Mixing tabs and spaces — YAML only allows spaces. A single tab character causes a parse error.
  • Inconsistent indentation — mixing 2-space and 4-space indentation in the same file
  • Unquoted special strings — values like yes, no, null, 3.0 have special meaning. Quote them if they are literal strings.

❓ Frequently Asked Questions

How many spaces should I use for indentation?
2 spaces is the most common convention for Kubernetes and Docker Compose. Some teams prefer 4 spaces. Pick one and be consistent.
Can it fix broken YAML?
The formatter reports parse errors with line numbers, but cannot automatically fix structural issues like wrong indentation levels. Use the error messages to fix manually.
Does it sort keys?
The formatter preserves key order by default. Some YAML tools offer alphabetical sorting as an option.
Is my data private?
Yes — all processing runs entirely in your browser. Your data is never sent to any server.
Is this tool free?
Completely free — no login, no usage limits, works offline once loaded.
Yes — completely free, no login required, no usage limits.
Is my data private?
Yes — all processing runs in your browser. Your data is never sent to any server.
Does it work offline?
Yes — once the page is loaded, the tool works without an internet connection.
🔒
Your data stays private. All processing happens entirely in your browser using JavaScript. Nothing is ever sent to our servers. You can even use this tool offline after the page loads.