# YAML Validator

> Validate YAML and locate syntax errors with line, column and a code frame — locally in your browser, nothing uploaded.

Canonical: https://host-tools.com/tools/yaml-validator/

---

## What does this tool do?

YAML Validator checks whether a YAML document is syntactically valid. If it is,
you get a clear confirmation and the number of documents found. If it is not,
you get the error with its **line and column** and a short code frame pointing at
the problem — so you can fix it without guessing.

## What YAML is validated

This tool validates **YAML 1.2 (core schema)**. That means plain scalars stay
plain: `yes`, `no`, `on` and `off` are strings, and a value such as
`2026-09-10` is a string, not a date. It accepts the usual structure — nested
mappings, sequences, quoted and multiline strings, and numbers.

## Indentation: spaces, not tabs

YAML is indentation-sensitive, and **tabs are not allowed** for indentation. A
common source of errors is mixing tabs and spaces, or dedenting a mapping at the
wrong column. The validator reports exactly where the indentation breaks.

## Anchors, aliases and merge keys

Anchors (`&name`), aliases (`*name`) and merge keys (`<<: *name`) are supported,
so you can validate configurations that reuse blocks. Undefined aliases and
malformed anchors are reported as errors.

## Multi-document YAML

A stream separated by `---` markers is validated as multiple documents. An error
in any document is reported with the line and column where it occurs.

## Duplicate keys

Duplicate mapping keys are treated as invalid. If the same key appears twice,
the validator reports it, because relying on "the last one wins" is a frequent
source of configuration bugs.

## YAML Validator vs Code Formatter

These are different jobs:

- **Code Formatter** makes YAML look tidy (indentation and spacing).
- **YAML Validator** tells you whether it is valid and exactly where it breaks.

A file can be invalid but "formatted", or valid but ugly. Use each for what it
does.

## Limits

Inputs up to about 500 KB validate instantly. Between 500 KB and 1 MB you will
see a warning, and inputs above 1 MB are rejected. YAML parsing is slower than
JSON, so this limit keeps the tool responsive in the browser.

## Privacy

Your YAML is parsed locally in your browser. It is not uploaded, stored or sent
anywhere — safe for secrets in configuration files.
