Report a problem

YAML Formatter

Validate YAML with line and column error reporting, re-indent it cleanly with 2 or 4 spaces, or convert it to JSON for APIs and scripts. Built for config files and CI pipelines. Free, no sign-up, runs entirely in your browser.

Your config never leaves your browser

Parsing and conversion run locally with js-yaml. Nothing is uploaded or logged.

Validation-
Input size0 B · 0 lines
Output size0 B · 0 lines

Beautify parses then re-dumps the document, so anchors, tags and comments are normalised exactly as a parser sees them.

A YAML formatter built for config files and CI pipelines

YAML runs modern infrastructure: Kubernetes manifests, GitHub Actions and GitLab CI workflows, docker-compose files, Ansible playbooks and Helm values are all YAML. It is also famously picky, because indentation is the syntax. A workflow that fails with a cryptic error at 7am is usually one stray space or a tab character away from passing. This YAML formatter parses your document with js-yaml, the library behind countless Node.js tools, and writes it back with clean, uniform 2 or 4-space indentation. Because the output reflects exactly how a parser understands the file, the round trip doubles as a sanity check: anchors are resolved, tags normalised, and any structural surprise becomes visible before it reaches a pipeline.

Validation runs on every keystroke. When parsing fails you get the parser's reason plus the exact line and column of the offending token, which pinpoints the classic mistakes: inconsistent indent depth, tabs used for indenting (never valid in YAML), missing colons and unbalanced quotes.

Convert YAML to JSON in one click

Plenty of tools accept JSON but not YAML. The YAML to JSON mode parses your config and prints the equivalent JSON with 2-space indentation, ready for a REST API call, a test fixture, an environment-specific override or a JavaScript project. Multi-line strings, nested maps, lists and scalar types all carry over, and the result downloads as a .json file.

How to format YAML online

Paste YAML into the input box, click Load example to see a sample CI workflow, or upload a .yaml or .yml file (read locally, never sent anywhere; config files often contain internal hostnames or credentials, so local processing matters). Choose Beautify, Validate only or YAML to JSON, pick an indent width, and the output updates instantly. Copy the result or download it. The page is one static script, so it keeps working offline after the first load.

Frequently asked questions

What does a YAML formatter do?

A YAML formatter parses a YAML document into a data structure and writes it back out with clean, consistent indentation, normalised spacing and standard list markers. Anchors, tags and comments introduced by hand are resolved or normalised by the round trip, so the output reflects exactly how a parser understands the file. That makes it a reliable way to tidy config files that grew messy through many small edits.

How does YAML validation and error reporting work?

Every input change is parsed with js-yaml, the same library used by countless Node.js tools. Valid documents show a green confirmation. Invalid documents surface the parser's reason for failing plus the exact line and column of the offending token, which pinpoints classic mistakes like inconsistent indentation, tabs used for indenting, missing colons or unbalanced quotes.

Why convert YAML to JSON?

Many tools and APIs accept JSON but not YAML, so converting is the quickest way to reuse a config file elsewhere: paste a GitHub Actions workflow or docker-compose file and get the equivalent JSON for a REST call, a test fixture or a JavaScript project. The conversion mode pretty-prints the JSON with 2-space indentation and downloads as a .json file.

What indentation should I use for YAML?

Two spaces is the dominant convention in Kubernetes manifests, GitHub Actions workflows, Ansible playbooks and most style guides, so this tool defaults to it. Four spaces is offered for teams that prefer deeper visual nesting. Tabs are not valid indentation in YAML at all, which is why the tab option you see in other formatters is absent here.

Is my YAML uploaded anywhere?

No. Parsing, re-dumping and conversion all run locally in your browser with JavaScript. Your config files, which often contain internal hostnames or credentials, never leave your device, and the page keeps working if you disconnect from the internet after it loads.

Related tools