YAML Formatter & Validator

Beautify, validate, and tidy YAML. Everything runs in your browser, so your data never leaves the page.

About this YAML formatter

This is a free online YAML formatter and validator. Paste any YAML document into the input panel and you'll get a tidy, syntax-checked version in the output panel. If the input is malformed, the tool tells you exactly where the parser failed.

Features

  • Format any YAML with a 2 or 4 space indent.
  • Validate with precise line and column error reporting.
  • Sort keys alphabetically at every level for deterministic diffs.
  • Copy the result or download it as a .yaml file.

How it works

The tool parses your YAML with the js-yaml library (YAML 1.2 core schema) running in your browser. After parsing, it re-emits the document with your chosen indentation and (optionally) sorted keys. No network round-trip is involved for the document itself.

Privacy

Your YAML never leaves your browser. The whole tool runs locally as JavaScript on this page, so you can safely paste sensitive configuration, Kubernetes manifests, CI workflows, or secrets without anything being uploaded.

Frequently asked questions

Does this tool send my YAML anywhere?
No. All parsing, formatting, and validation happens locally in your browser. Nothing is sent to a server.
Which version of YAML is supported?
The parser implements YAML 1.2 with the core schema. That covers the vast majority of real-world YAML, including documents written for tools like Kubernetes, Docker Compose, GitHub Actions, and Ansible.
Why is the parser rejecting my tabs?
YAML disallows tab characters for indentation by design. Replace tabs with spaces (the indent selector decides how many) and the document will parse.
What happens to comments and original quoting?
YAML comments are stripped during parsing and are not preserved on output. Quoting style and key order are also normalized. If preserving the original formatting matters, use a round-tripping tool like ruamel.yaml locally.