AZ Tools

YAML Formatter & Validator

Developer

Paste any YAML and get a re-emitted clean version: consistent indentation, configurable line width, optional alphabetical key sort, optional anchor / reference expansion. Errors are shown inline with the parser's location info. Useful for cleaning up GitHub Actions workflows, Kubernetes manifests, Astro / Vite configs, or any hand-edited YAML that drifted.

● Valid
Formatted
server:
  host: localhost
  port: 8080
features:
  - search
  - analytics
  - export
admins:
  - name: Alice
    role: owner
  - name: Bob
    role: editor
config:
  timeout: 30
  retries: 3
prod:
  timeout: 30
  retries: 3
  url: https://aztools.app

How to use

  1. Paste your YAML in the input.
  2. Tweak indent, line width, sort keys, or expand anchors.
  3. Read the formatted output and copy.

Frequently asked questions

What YAML version is supported?
YAML 1.2 via js-yaml — the same parser used in many CI tools. Anchors (&) and references (*) are accepted; merge keys (<<: *anchor) are normalized when 'expand anchors' is on.
Are comments preserved?
No. js-yaml drops comments because the YAML spec doesn't attach them to nodes. If your YAML has critical comments, format a section at a time and paste comments back manually.
What does 'expand anchors' do?
When on, the formatter inlines anchored values everywhere they're referenced, so the output has no & / * markers. Off keeps the original references.
Why is the line width 100 by default?
100 columns matches GitHub's default code review width — wide enough for most inline scalars without word-wrapping in diffs.

Related tools