Zokilos

YAML Formatter & Validator

Validate and pretty-print block-style YAML

Supports block-style mappings/sequences, quoted & plain scalars, and JSON-like flow [...]/{...}. Anchors, aliases and multiline block scalars (|, >) aren't supported.

What Is This YAML Formatter & Validator?

A real YAML parser that checks your YAML is actually valid, reports specific syntax errors with line numbers when it isn't, and re-prints valid YAML with consistent indentation.

How to Validate and Format YAML

1

Paste your YAML.

2

Click Validate & Format.

3

Read the status badge, then copy the result.

What Gets Validated

Block-style mappings and sequences, quoted and plain scalars, and JSON-like flow-style arrays and objects ([...] / {...}) are actually parsed into a real structure — not just checked with a regex — so indentation problems, malformed keys, and structural mistakes are genuinely caught.

Understanding Validation Errors

Every error names the exact line number and what went wrong — "Unexpected indentation" means a line's spacing doesn't line up with any valid level in its surrounding structure, and "Expected \"key: value\"" means a line inside a mapping doesn't match that pattern.

Indentation Options

Choose 2 or 4 spaces for the re-formatted output. This only affects how valid YAML is re-printed, not how your input is validated.

Flow-Style vs Block-Style YAML

Block style spreads a structure across multiple indented lines, the way most hand-written YAML looks. Flow style packs it onto one line using JSON-like brackets, like tags: [a, b, c]. Both are supported as values, including flow-style nested inside block-style structures.

Important: Anchors, Aliases, and Block Scalars Aren't Supported

Real-world YAML from Kubernetes manifests, Ansible playbooks, and GitLab CI configs often uses anchors and aliases (&name / *name, for reusing a value in multiple places) and multiline block scalars (| / >, for embedding a multi-line string). Neither is supported here — YAML using either will fail validation, even though it's valid YAML elsewhere.

Why Tabs Are Rejected

Because the YAML specification itself disallows tabs for indentation, not because this tool adds an extra restriction. Pasting tab-indented YAML produces a clear error telling you to switch to spaces.

What This Tool Doesn't Do

  • No anchors, aliases, or references (&, *)
  • No multiline block scalars (|, >)
  • No multi-document files (--- separated documents are treated as one)
  • No YAML schema validation against a specific spec (like OpenAPI or Kubernetes schemas)

Limitations

  • Won't handle real Kubernetes/Ansible/GitLab CI files that use anchors or block scalars
  • No schema-aware validation, only YAML syntax
  • Tabs are rejected, matching the YAML spec but tripping up tab-indented files

Benefits of Using This Tool

  • Real parsing, not a regex guess — catches genuine structural errors
  • Specific error messages with line numbers
  • Handles both block-style and flow-style YAML
  • Runs entirely in your browser — nothing uploaded to a server
  • Free, with no sign-up required

Frequently Asked Questions

Does this support Kubernetes, Ansible, or GitLab CI YAML?

Only if that file avoids anchors/aliases (&, *) and multiline block scalars (|, >), which are common in exactly those file types. Real-world Kubernetes manifests and Ansible playbooks often use one or both, and this parser will reject them with a syntax error rather than support them.

What does an "Unexpected indentation" error mean?

A line's indentation doesn't line up with any valid level in the surrounding structure, such as being indented one space more or less than its siblings. YAML uses indentation to define nesting, so inconsistent spacing breaks the structure.

Why are tabs rejected for indentation?

Because the YAML specification itself disallows tabs for indentation — this isn't an extra restriction added by this tool, it's a real rule of the YAML format. Use spaces instead.

Does it support flow-style YAML like [1, 2, 3] or {a: 1}?

Yes. JSON-like flow-style arrays and objects are parsed and can appear as values within block-style mappings and sequences.

Is this a real validator, or does it just reformat without checking?

It's a real parser. Your YAML is actually parsed into a structure, and any syntax problem produces a specific error message with the line number it occurred on, not just a pass/fail guess.

Is my YAML sent to a server when I use this?

No. Parsing, validating, and formatting all happen entirely in your browser using JavaScript. Nothing you paste here is uploaded anywhere.