YAML Formatter, Validator & Linter Online Validate and tidy YAML, flagging duplicate keys.
100% offline
Input97 chars · 8 lines
Output98 chars
Formatted · 8 lines
name: Anvil
version: 1.0
features:
  - format
  - validate
server:
  host: localhost
  port: 8080

About YAML Formatter, Validator & Linter Online

YAML powers CI pipelines, Kubernetes manifests, and `docker-compose` files — and a single stray tab or misaligned key can break a whole deploy. This free YAML formatter and validator parses your document, normalizes indentation to clean two-space levels, tidies quoting, and re-emits stable, readable YAML.

The validator surfaces the problems linters miss: duplicate keys, tab indentation, and parse errors are reported with the exact line number, while anchors and aliases survive formatting untouched. It's a fast way to lint a config before you commit it.

Everything runs entirely in your browser. Your YAML — which often holds secrets, hostnames, and infrastructure details — is never uploaded, so you can safely format and validate sensitive configs offline.

Features

  • Normalize indentation to 2 spaces and tidy quoting
  • Validate with precise line numbers for errors
  • Flag duplicate keys and tab indentation
  • Preserve anchors and aliases through formatting
  • Runs fully offline — nothing leaves your device

How to use

  1. Paste your YAML into the input pane.
  2. Click Format to normalize indentation, or Validate to check it.
  3. Read the status line — green confirms valid YAML, red shows the error and its line number.
  4. Copy the clean, formatted YAML from the output pane.

Frequently asked questions

Why is my YAML invalid because of tabs?

The YAML spec forbids tab characters for indentation — only spaces are allowed. This tool flags any tab indentation with its line number so you can replace it with spaces.

Does it detect duplicate keys?

Yes. Duplicate keys in the same mapping are reported as an error with the line number of the repeat, since most parsers silently drop all but the last value.

Are anchors and aliases preserved?

Yes. Formatting re-emits the parsed document rather than the resolved data, so YAML anchors (&name), aliases (*name), and merge keys (<<) stay intact.

Is my YAML uploaded to a server?

No. Parsing, validation, and formatting all happen locally in your browser. Your config — including any secrets it contains — never leaves your device.

Everything runs locally in your browser — your input is never uploaded.