YAML Validator Online: Syntax Errors & JSON Preview

Validate YAML syntax, locate line and column errors, and inspect a copyable JSON preview. Supports multiple documents with clear parsing and preview limits.

← Developer Tools

Validate YAML syntax in your browser and inspect a JSON representation of the parsed document.

DeveloperYAML 1.2Browser processing

Result: Enter YAML, then validate it.

What this validator checks

The parser checks YAML syntax and supports YAML 1.2 data such as mappings, sequences, strings, numbers, booleans, null values, anchors and aliases. Multi-document YAML separated with --- is supported.

Parsing is not application validation

Valid YAML can still be wrong for Kubernetes, GitHub Actions, Docker Compose or another application. Those systems apply their own schema and semantic rules after YAML parsing.

How to find a YAML syntax error

  1. Paste up to 100,000 characters of YAML.
  2. Select Validate YAML. If parsing fails, read the reason and the one-based line and column number.
  3. Check indentation, quotes and collection brackets near that position, then validate again. The reported location is where parsing stopped; the cause may be earlier.
  4. Select Show Parsed JSON to inspect the values and types, then copy the preview if needed.

A small YAML example

name: Toolszzz
enabled: true
items:
  - one
  - two

This document contains a mapping with a string, a boolean and a two-item sequence. Keep indentation consistent and use spaces for indentation. A missing closing bracket in items: [one, two produces a syntax error; duplicate mapping keys are also rejected.

Multiple documents, aliases and JSON limits

Separate YAML documents with ---. The JSON preview shows multiple documents as an array. Anchors and aliases may parse successfully even when a JSON preview is unavailable: JSON cannot represent cyclic references, infinity or NaN. Expanded previews are limited to 10,000 values. A preview limitation does not mean the YAML syntax is invalid.

The parser uses the YAML 1.2 core schema. Quote values that must remain strings, such as identifiers or values with significant leading zeros. Parsed numbers use JavaScript number precision; the preview is not a lossless conversion for large integers. Comments, original quoting and formatting are not retained.

Common questions

Does valid YAML mean my configuration will work?

No. This checks parsing, not required fields, allowed options, external references or your application’s schema. Run the application’s own validation before deploying a configuration.

Why did my old JSON preview disappear?

Editing the input clears the previous preview so that an outdated result is not mistaken for validation of the new text. Validate or generate a preview again after every change.

Privacy and library

Your YAML text is parsed in the browser and is not uploaded by this validator to a parsing server. The validator loads the pinned js-yaml 5.4.2 JavaScript package from jsDelivr.

Reference: js-yaml package documentation.

Related tools