CruxDevCruxDev Tools Prompts
dev Utility • Zero-Server Privacy • 100% Client-Side

YAML Validator & Formatter

Validate YAML syntax, auto-format indentation, and convert YAML to JSON instantly.

Overview

Validates YAML against a real YAML 1.2 parser as you type, pinpoints syntax errors with line and column, and shows the parsed document as JSON so you can see exactly what your config decodes to.

How It Works

Paste YAML in the left pane; a Valid/Invalid badge and a green or red border appear immediately, and the right pane shows the document parsed as pretty-printed JSON (with Copy JSON) when it is valid. Auto-Format re-serialises the input through the parser's document model, normalising indentation while keeping comments, anchors and every document in the file.

Step-by-Step Usage Guide

  1. Paste the YAML file or fragment into the left pane.
  2. Fix any Invalid error using its line and column pointer.
  3. Read the JSON view to confirm values, types, and nesting.
  4. Run Auto-Format to normalise indentation, then copy the result back to your file.

Technical Specifications & Standards

Validation uses the same yaml library (v2) that many Node tools depend on, not a regex approximation, so the error messages are the real ones — including the at line X, column Y location the library attaches. When parsing fails, the raw library message is shown in red rather than paraphrased. Auto-Format parses first and, when the input is invalid, leaves your text alone and shows the first line of the error in a toast, so it can never replace your YAML with an error page. Merge keys (<<: *anchor) are resolved in the JSON view, and multi-document files are validated document by document.

Targeted Use Cases

  • Debugging a CI workflow or compose file that a remote parser rejected without location info.
  • Checking indentation-sensitive Kubernetes manifests before kubectl applies them.
  • Confirming what a config actually decodes to — booleans, nulls, and nested structures — via the JSON view.
  • Normalising inconsistent indentation across a directory of config files.

Notes & Gotchas

  • Multi-document streams (files with --- separators) are validated together: the badge reports how many documents parsed and the JSON view shows them as an array.
  • Auto-Format uses the library's default formatting; review the diff before committing, since indentation and quoting style may be normalised (key order is kept).
  • This is syntax validation only. Schema-level checks (required keys, value ranges, OpenAPI rules) need a schema-aware tool.
  • The JSON view is the fastest way to catch classic YAML traps: unquoted true or false becoming booleans, version-like values becoming numbers, and tabs where spaces are required (YAML 1.2 keeps yes and no as strings).

Frequently Asked Questions

Which YAML specification is supported?

YAML 1.2 via the npm yaml v2 library — the dialect used by docker-compose, GitHub Actions, and Kubernetes tooling.

Does it support multi-document files?

Yes. Every document separated by --- is validated, the badge reports the document count, and the JSON view shows them as an array.

Does it validate my values, not just the syntax?

No — it is a syntax validator plus a JSON preview. There is no schema or OpenAPI validation.

Is my YAML uploaded?

No. Parsing runs entirely in your browser.