YAML

YAML formatter

Tidy YAML configuration files and normalize their indentation and spacing. If the file does not parse, DocuFormat tells you where, instead of guessing.

config.yamlDetected: YAML ✓
server:    host: localhost    port:   8080features: [auth,   logging]list:- alpha-   beta
output.yaml
server:  host: localhost  port: 8080features: [auth, logging]list:  - alpha  - beta
✓ Valid YAML · formatted locally

What gets cleaned up

DocuFormat parses your YAML and writes it back out in a consistent style: two-space indentation, list items indented under their key, and no stray padding around values. Inline collections such as [auth, logging] stay inline, tidied but not restructured.

Multi-document files

Files with several documents separated by ---, common in Kubernetes manifests, are parsed and formatted document by document, and the separators are kept.

Review the output

Because formatting re-serializes the parsed document rather than editing text in place, it is worth glancing over the result, especially for files that rely on a particular style such as quoting, anchors or long folded strings. Compare it with the original before committing.

Why format YAML at all?

In YAML, indentation is the structure. A config that is consistently indented is easier to review, and mis-nested keys are easier to see. If the file is already broken, start with the YAML validator.

Questions, answered

Does it support multiple YAML documents?

Yes. Documents separated by --- are formatted individually.

Can it minify YAML?

No. Minifying does not make sense for indentation-based YAML, so that option is not offered.

Does my YAML leave my browser?

Not for formatting or validation. Content is only sent to an AI provider if you click AI Fix or Explain.

Try the YAML formatter on your own input.

Paste it, format it, and fix it if it is broken, once DocuFormat opens.