YAML Validator & Formatter

Paste YAML to check its syntax, pinpoint errors and get clean, consistently formatted output.

Output options

YAMLinput

Empty

YAMLoutput

YAML output appears here

Runs entirely in your browser, so nothing is uploaded. Fair-use limits apply (5 MB per input, rate-limited conversions) to prevent spam and bots.

Load from URL

The file is fetched directly by your browser, so the server must allow cross-origin requests.

Keyboard shortcuts

Ctrl / ⌘ + Enter Convert now
Ctrl / ⌘ + S Download the output
Alt + Shift + C Copy the output
Alt + Shift + F Fix and format the JSON input
Alt + Shift + S Swap direction
Alt + Shift + T Cycle through code, tree and map views
Ctrl / ⌘ + Z Undo, including Format, Fix and Clear
Esc Leave full screen
Editor text size

Normalize messy YAML

Mixed indentation, inline maps and unnecessary quotes all parse fine but are hard to review. The formatted output gives every file the same shape.

Input
services:
    web:
        image: "nginx:1.27"
        ports: [ "80:80" ]
        environment: {LOG_LEVEL: info, DEBUG: 'false'}
Formatted
services:
  web:
    image: nginx:1.27
    ports:
      - '80:80'
    environment:
      LOG_LEVEL: info
      DEBUG: 'false'

Common YAML errors and how to fix them

These are the messages you will see most often, in this validator and in tools like kubectl, Helm and docker compose.

Error messageWhat it means and how to fix it
tab characters must not be used in indentation YAML allows only spaces for indentation. Replace each tab with spaces.
bad indentation of a mapping entry A key is indented differently from its siblings, or a plain value contains ": ". Line the key up with its neighbours, or quote the value.
mapping values are not allowed in this context The same problem as reported by kubectl and Helm: usually an unquoted value containing ": ", such as a URL or a time. Quote the value.
end of the stream or a document separator is expected A list item or key sits at the wrong indentation level, for example a list followed by a mapping at the same level.
unexpected end of the stream within a flow collection An inline list [ … ] or map { … } is never closed. Add the missing bracket.
duplicated mapping key The same key appears twice in one mapping. Remove or rename one of them.
unidentified alias An alias such as *defaults is used before, or without, its anchor &defaults.

What the validator checks

Break the file on purpose with the buttons and watch which check catches it.

Syntax and indentation

Tabs, misaligned keys, unclosed quotes and brackets are reported with the exact line and column.

Duplicate keys

A key defined twice in the same mapping is an error, where some parsers silently keep the last value.

Anchors and aliases

Every alias must point to an anchor defined earlier in the document, and merge keys must reference mappings.

Multiple documents

Each document in a --- separated file is parsed, and the notes show how many were found.

Private by default

Validation runs in your browser, so secrets in CI files and manifests never leave your machine.

More tools

Converters, validators and step-by-step guides for every place JSON and YAML meet.

Frequently asked questions

How do I validate YAML online?

Paste your YAML or drop a .yaml or .yml file. The badge shows Valid YAML or Invalid YAML as you type. For an invalid file you get the error message with the exact line and column, and the line is highlighted in the editor.

What does the formatted output do?

It re-writes the same data with consistent indentation and quoting: block style, your chosen indent, and quotes only where needed. It is a quick way to normalize a file before committing it.

Are comments kept in the formatted output?

No. The validator parses the YAML into data and writes it out again, and comments are not part of the data. Use the output to check structure, and keep your original file if its comments matter.

Can I validate a multi-document YAML file?

Yes. Documents separated by --- are each checked, and the formatted output keeps them as separate documents. The notes under the editor show how many documents were found.

Does it check Kubernetes or Docker Compose schemas?

It checks YAML syntax, not a specific schema. A file can be valid YAML and still be rejected by kubectl or docker compose for an unknown field. Use kubectl apply --dry-run=server or docker compose config for schema checks.

Which YAML version is used?

Parsing follows the YAML 1.2 core schema, so yes, no, on and off stay strings. With "YAML 1.1 safe" on, the output quotes those words, so older parsers such as PyYAML read them as strings too.