YAML Validator
Paste a YAML document and instantly validate its syntax with js-yaml, the same library many developer tools rely on. If it's valid, you'll see the parsed structure as JSON to confirm it reads the way you expect.
How it works
- Paste or type your YAML into the input panel.
- The validator tries to parse the document with js-yaml.
- If it's valid, the resulting structure is shown as readable JSON, so you can confirm the types and hierarchy are what you expected.
- If there's an error, js-yaml's message is shown, including line and column when available.
- Copy the resulting JSON or download it as a .json file.
Use cases
- Validate CI/CD config files (GitHub Actions, GitLab CI, Docker Compose) before committing.
- Debug indentation errors, the most common cause of invalid YAML.
- Confirm how data types (numbers, booleans, null) are interpreted in a YAML file.
- Mentally translate YAML into its JSON equivalent to understand its structure.
Use cases
- Validate CI/CD config files (GitHub Actions, GitLab CI, Docker Compose) before committing.
- Debug indentation errors, the most common cause of invalid YAML.
- Confirm how data types (numbers, booleans, null) are interpreted in a YAML file.
- Mentally translate YAML into its JSON equivalent to understand its structure.
Common mistakes
- Mixing spaces and tabs for indentation.YAML only allows spaces. A tab causes a syntax error that's sometimes hard to spot by eye; the validator shows you the exact line.
- Writing values like yes, no, on, off expecting them to be read as text.In YAML these values are usually interpreted as booleans. If you need the literal text, wrap it in quotes: "yes".
- Using inconsistent indentation between elements at the same level.All elements at the same level must have exactly the same number of indentation spaces.
Frequently asked questions
No. All parsing happens locally in your browser using the js-yaml library. Your YAML never leaves your device.
YAML uses indentation (spaces, never tabs) to represent the hierarchy of data, instead of braces or brackets like JSON. One extra or missing space can completely change the parsed structure or cause a syntax error — exactly the kind of problem this tool catches.
You'll see the exact error message reported by js-yaml, which usually includes the line and column where the problem was detected, along with a description of what was expected.
Showing the structure as JSON lets you confirm unambiguously how each value was interpreted (for example, whether 'yes' was read as text or as a boolean) — something that's harder to verify with reformatted YAML alone.
Alternatives
Command-line tools like yamllint are useful for validating whole files inside a CI pipeline. This tool is faster for checking a one-off fragment and immediately seeing how it's parsed as JSON.