Config cleanup

YAML Formatter and Indentation Checker

Fix YAML indentation, trim noisy whitespace and catch common structure problems before config files reach production.

Input

0 bytes

Result

Ready

YAML IndentationTabs, spacing and nested keys JSON FormatterFormat API payloads XML FormatterClean XML documents Python FormatterNormalize Python snippets

Reference notes

YAML indentation for configuration files

Indentation first

YAML is whitespace-sensitive. This indentation checker converts tabs, trims trailing spaces and keeps list indentation readable.

Local processing

Configuration snippets are processed in the browser. Formalint does not upload pasted YAML to a backend.

Common checks

The validator flags tabs, odd indentation, duplicate mapping keys in the same block and unbalanced brackets or quotes.

Frequently asked

YAML formatter questions

Why is indentation so strict in YAML?

YAML uses indentation instead of brackets to represent structure, so two spaces versus four spaces on a nested key changes which parent it belongs to. Mixing tabs and spaces is a common source of parse errors.

Why did a value like "yes" or "03" change unexpectedly?

YAML auto-converts certain unquoted strings into booleans, numbers, or null. Values like yes, no, on, off, and numbers with leading zeros should be quoted if you want them treated as literal text.

What common structure issues does the checker catch?

It flags inconsistent indentation between sibling keys, tab characters mixed with spaces, and duplicate keys at the same level, which most parsers silently overwrite rather than error on.

Is YAML used only for config files?

YAML is common in CI/CD pipelines like GitHub Actions and GitLab CI, Kubernetes manifests, Docker Compose files, and application configuration, in addition to general config files.

Check the original input before cleanup

Validate checks your original text without rewriting whitespace. Format checks it first, then applies cleanup. A failed check displays the original input unchanged, including tabs; copy and download retain that input rather than an earlier successful result.

  • A tab before port: 8080 is reported as an indentation error. Replace indentation deliberately and run the check again.
  • constructor: build and __proto__: config are ordinary key names. One occurrence does not mean a duplicate.
  • Two port: keys in the same simple mapping are reported as duplicates. Resolve which value was intended before deploying.

This is a lightweight, line-based check, not a complete YAML parser or application-schema validator. Its two-space indentation convention can reject otherwise valid YAML. Multiline flow collections, block scalars, anchors, quoted keys and complex mappings need validation in your application's YAML parser. Cleanup can change whitespace-sensitive values, so keep the original and review a diff before using formatted output.

Use the configuration validation checklist to separate syntax, schema and deployment checks, or open the developer workspace for related data inspection.