We use cookies and similar technologies to enhance your browsing experience, analyze site traffic, and personalize content and ads. By clicking "Accept", you consent to our use of cookies. Learn more in our Privacy Policy.
by Cosmovex
Format and beautify YAML, validate YAML syntax, convert YAML to JSON and JSON to YAML. No signup required. Works entirely in your browser.
This is a free, in-browser YAML formatter and validator. Paste a YAML document and it parses the text, reports syntax errors with the line and column where they occur, and re-emits clean, consistently indented output. It also converts between YAML and JSON in both directions, so you can paste a config in one format and get the other back.
Everything runs in your browser. The YAML you paste is parsed and formatted locally on your machine, and nothing is sent to a server or stored anywhere. That matters for YAML specifically, because so many YAML files hold things you don't want leaving your laptop: Kubernetes manifests, CI pipeline definitions, Ansible playbooks, application config with hostnames and connection details. You can validate a production manifest or a secrets-adjacent config file without it ever touching the network.
Paste or type YAML into the editor and the tool parses it on every change. There are three things it gives you:
The parser follows standard YAML rules: it understands mappings, sequences, scalars, multi-line block strings, anchors and aliases, and explicit type tags. No part of this requires an account or a network connection.
Say you have this fragment and the formatter reports an error:
server:
host: localhost
port: 8080
tags: [web, api]
The message points at the port line: it's indented one space deeper than host, and YAML treats inconsistent indentation under the same mapping as a structural error. Line up port with host and it parses. Formatted output comes back as:
server:
host: localhost
port: 8080
tags:
- web
- api
Note two things the formatter did. It kept 8080 as a number, not a quoted string, because unquoted numeric scalars are numbers in YAML. And it expanded the inline [web, api] flow sequence into block style, which is the more readable form most config files use. If you'd rather keep values as strings (for example a ZIP code or a version like 1.10), quote them explicitly: version: "1.10".
YAML is the config language for a lot of infrastructure tooling, and most editing of it still happens by hand, so a quick validate-and-format pass catches a lot of mistakes before they reach a pipeline:
kubectl apply, where a misplaced key silently lands a field in the wrong block.Because it's all local, you can run a real production config through it without worrying about where the text goes.
Most YAML pain comes from a handful of recurring traps:
no, yes, on, off, true, and false are booleans. A country list with NO (Norway) becomes false. Quote any string value that could be read as a boolean.08 is invalid (looks like a malformed octal), and 1.20 loses its trailing zero. Quote version numbers, ZIP codes, and IDs with leading zeros.time: 10:30 can confuse the parser. Quote it: time: "10:30".When the validator flags a line, check indentation and quoting first; that's where the answer usually is.
YAML lets you define a block once and reuse it, which JSON can't do. You mark a node with an anchor (&name) and reference it later with an alias (*name). The << merge key folds an anchored mapping's keys into another mapping:
defaults: &defaults
retries: 3
timeout: 30
production:
<<: *defaults
timeout: 60
Here production inherits retries: 3 from defaults and overrides timeout to 60. This keeps shared config in one place instead of copy-pasting it across environments.
When you convert this to JSON, the aliases are resolved and expanded into full literal values, because JSON has no concept of references. So the JSON production block will contain both retries and timeout written out in full. That expansion is expected, and it's a good way to see exactly what your anchors resolve to.
Unquoted `yes`, `no`, `on`, `off`, `true`, and `false` are interpreted as booleans. Wrap the value in quotes (for example `"no"`) to keep it as a string.
No. The YAML spec forbids tabs for indentation; you must use spaces. A tab anywhere in the structural indentation produces a parse error.
No. Parsing, validation, formatting, and conversion all run in your browser. The text never leaves your machine, which is why it's safe to check production manifests and config files here.
YAML is a superset of JSON aimed at human-edited config, with indentation-based structure, comments, and anchors. This tool converts in both directions. Note that comments and anchors don't survive a round-trip to JSON, since JSON has neither.
Unquoted `1.20` is parsed as a floating-point number, which drops the trailing zero. Quote it as `"1.20"` to keep it exactly as written.
Use a block scalar. `|` keeps line breaks literally; `>` folds wrapped lines into spaces. Both are followed by an indented block of text, for example `description: |` on one line and the indented content below it.
Check for a mix of tabs and spaces, or a key indented a different number of spaces than its siblings under the same parent. YAML structure is defined entirely by indentation, so even one extra space changes meaning.
Yes. YAML files can hold several documents separated by `---`, which is common in Kubernetes manifests. The parser reads each document in the stream.