YAML Beautifier

Paste YAML to re-indent it and pretty print it; invalid YAML is reported with the error.

What you can do here

How the YAML beautifier works

The YAML is parsed with js-yaml and written back out with two-space indentation. Parsing first means the output is guaranteed valid and every document in a multi-document file is formatted. Comments are not kept, because YAML parsers discard them, so keep your original if comments matter.

server: {host: localhost,   port: 8080}
features: [auth,logging]

becomes

server:
  host: localhost
  port: 8080
features:
  - auth
  - logging

Common questions

Is YAML pretty print the same as beautify?

Yes. Both re-indent and normalize the YAML without changing the data.

Why did my comments disappear?

YAML parsers drop comments, so re-serialized output cannot include them. Keep the original file if you need them.

Does it validate YAML?

Yes. Invalid YAML is rejected with the parser error, including the line.