Skip to content

YAML Formatter & Validator Online

Tidy and validate YAML.

  • Free
  • No sign-up
  • No watermark
  • Works in your browser

Also called: YAML beautifier, YAML validator, format YAML online.

About YAML Formatter

Tidy and check YAML in one step. Paste a config file, such as a Docker Compose, Kubernetes or CI file, and the tool re-indents it consistently, keeps your comments and reports the exact line and column of any syntax error. It reads YAML 1.2, supports several documents separated by ---, and can sort the keys alphabetically.

How to use YAML Formatter

  1. Paste your YAML or open a .yaml or .yml file.
  2. Choose 2 or 4 spaces of indentation and, if you want, tick Sort keys A–Z.
  3. Read the formatted result, or the error with its line and column.
  4. Copy the output or download it as formatted.yaml.

Tips and good to know

  • Tabs are not allowed for indentation in YAML; the error message will point at the line that uses one.
  • Sorting keys moves a comment together with the entry it is attached to, so a comment above a key may end up somewhere new.
  • Quotes can be normalised and long flow lists may be rewritten as { a, b }, but values are never re-typed: the text 007 stays text.

Indentation rules in YAML

YAML uses spaces for structure; tabs aren't allowed for indentation. Every item at the same level must be indented by exactly the same amount, and lists start with a dash followed by a space. A single wrong indent can move a key under a different parent without any error, which is a common cause of broken CI pipelines, Kubernetes manifests and Docker Compose files. Two spaces per level is the most common convention.

Quoting strings that contain colons, hashes or leading special characters such as * and & avoids surprises, because those symbols mean something in YAML.

Frequently asked questions

Does it keep my comments?

Yes. Comments are preserved, including end-of-line comments. Only blank-line spacing and indentation are normalised.

Which YAML version does it follow?

YAML 1.2 with the core schema, so words such as yes, no and on stay plain text instead of becoming booleans, as they do in older YAML 1.1 parsers.

Is YAML Formatter free?

Yes. YAML Formatter is free: no sign-up, no paid plan, no trial and no limit on how often you use it. It runs in your browser, and ToolzAura is paid for by ads, so every tool stays free.

Are my files uploaded?

No. This tool runs in your browser, so your input stays on your device.

Maintained by Malik Shaheer · Last reviewed · How we test tools · Report a problem

Related tools

YAML to JSON

Convert YAML to JSON.

Developer Tools

Base64 Encode and Decode

Convert text to and from Base64.

Developer Tools

Binary Translator

Convert text to binary and back.

Developer Tools

Hash Generator

Create SHA-1, SHA-256 and SHA-512 hashes.

Developer Tools

JWT Decoder

Decode a JWT header and payload locally.

Developer Tools

Password Strength Checker

Test how resistant a password is to guessing.

Developer Tools