Skip to content

YAML Validator

This YAML validator checks syntax as you type, points at the line to fix, and re-indents files without losing comments.

Input · YAML

Invalid YAML

Line 8, column 5

Line 8 is indented under a value, so it cannot start a new key.

6database:7  url: postgres://app@db/app8    pool: 10     ^9features:

Fix: Line it up with the key on line 7, or move it under a key that ends with a colon.

Invalid YAMLRuns in your browser

Load from a URL

Your browser fetches it directly, so the server must allow cross-origin requests (CORS).

How to validate YAML

  1. Paste YAML or open a .yml or .yaml file. It is checked as you type; Validate (Ctrl + Enter) opens the Report tab.
  2. An error shows the line and column, the code around it and a Fix: hint. Go to error jumps there.
  3. Format re-indents with 2 or 4 spaces (Indent). The Tree tab shows how each value is read.

Example: a key indented under a value

server:
  host: 0.0.0.0
  port: 8080
logging:
  level: info
    format: json

The report says Line 6 is indented under a value, so it cannot start a new key. and suggests lining it up with the key on line 5.

Other messages

Mistake Message
A tab used for indentation Tabs are not allowed for indentation.
The same key twice in one mapping Duplicate key.
title: Note: read this first Nested mappings are not allowed in compact mappings, with a hint to quote values that contain :
name: "web with no closing quote Missing closing "quote
user: @admin Plain value cannot start with reserved character @

Format keeps comments

app:   billing   # service name
replicas:    3
env:
    - name: LOG_LEVEL
      value: "debug"   # temporary

Format with 2 spaces:

app: billing # service name
replicas: 3
env:
  - name: LOG_LEVEL
    value: "debug" # temporary

Key order and quote style survive too; only spacing changes.

What the YAML validator does not check

It checks syntax (indentation, quotes, brackets, duplicate keys) in every document of the file, not style rules such as line length or a leading ---, which is yamllint’s job. It also does not know the schema of a Kubernetes manifest or a GitHub Actions workflow, so a misspelled field passes: convert the file with YAML to JSON and test it in the JSON Schema validator. To write YAML from JSON, use JSON to YAML.

Questions

Which YAML version does it check against?

YAML 1.2, where yes, no, on and off are plain strings; the Tree tab shows them as strings.

Why are tabs not allowed?

The YAML spec forbids tabs in indentation because editors show them at different widths. Tabs inside quoted values are fine.

Does it fix mistakes automatically?

No. A YAML error usually depends on what you meant, such as which level a key belongs to, so it points at the line instead of guessing.

Is my YAML sent anywhere?

No. It is parsed in this tab, so configs with hostnames and passwords stay on your machine.

Related tools

Esc