UtilDojo

Popular

Menu

YAML Formatter & Validator Online — Beautify YAML

  • This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.

YAML

Tab indents · Shift+Tab outdents · Esc then Tab moves on

Formatted YAML

Your Formatted YAML shows up here

Paste or type on the left, upload a file, or drop one onto the input.

Waiting for input

See also

About this tool

Paste YAML and the formatter re-indents it with 2 or 4 spaces as you type, and checks it at the same time. Comments are kept, anchors and aliases stay in place, and key order is untouched unless you turn on Sort keys. It works on Kubernetes manifests, docker-compose files, GitHub Actions workflows, OpenAPI specs and Helm values.

Take - run: npm ci # install under a steps: list. The formatter returns - run: npm ci # install, with one space before the comment and the same indent as the other steps. Values are written back exactly as you typed them: mode: 0644 stays 0644, 1e3 stays 1e3, a 20-digit ID is not rounded, and yes is not turned into true. Only whitespace and layout change. Long lines are not wrapped, and a file with several documents separated by --- is formatted document by document.

If the YAML is broken, nothing is formatted and you get each problem with its line and column and a hint. Typical findings are a tab used for indentation, a line that is not aligned with its siblings, an unclosed quote or bracket, and a duplicate key, which many parsers silently accept and then keep only the last value. Fix the first error and look again, because later errors are often side effects of it.

This checks syntax only. A file can be perfectly valid YAML and still be wrong for Kubernetes, Docker Compose or GitHub Actions, because those tools check their own schema. To turn the data into another format use the JSON Converter, and to compare two versions of a file use the Diff Checker. Everything runs in your browser, so manifests with secrets and internal configs stay on your machine.

Frequently asked questions

Does the formatter keep my comments?

Yes. Full-line and trailing comments stay where they are. A trailing comment is moved to one space after the value, and comments inside a block that gets re-indented move with it.

Will formatting change my data?

No. Values are written back exactly as you typed them, including quotes, numbers such as 0644 or 1e3, and words such as yes and no. Only spacing changes: indentation, extra spaces and the padding inside brackets. Folded text in a > block may be joined onto one line, which keeps its meaning.

Why does it say tabs are not allowed?

The YAML specification forbids tab characters for indentation, only spaces. Replace the leading tab with spaces. Tabs inside a value or after a key are fine.

Can I format a file with several documents?

Yes. Documents separated by --- are formatted one after another and the separators are kept. If any document has an error, nothing is formatted and each error is listed with its line and column.

Does it check my Kubernetes or Docker Compose file against its schema?

No, only the YAML syntax. A valid file can still have a wrong field name or a missing required key. Use kubectl, docker compose config or your CI linter for schema checks, and use this tool first to rule out syntax mistakes.

Is my YAML uploaded anywhere?

No. Parsing and formatting happen in your browser, so manifests, keys and internal configs never leave your device.

Related tools