Format and beautify YAML — re-indent, validate, minify, sort keys.
- Runs locally
- Category Format Converter
- Best for Turning pasted content or local files into a handoff-friendly format.
Formatted output appears here.What this tool does
Free online YAML formatter and validator. Paste a config and get clean, consistently indented output — 2 or 4 spaces (YAML spec forbids tabs). One-click minify produces a single-line flow-style document for transport. Syntax errors are reported with line numbers from the parser (eemeli/yaml, YAML 1.2) so you can fix invalid YAML in place. Optional "sort keys" recursively reorders every map alphabetically — useful for diff-stable Kubernetes manifests and lockfiles. 100% client-side: secrets in your `.env.yaml`, Helm values, GitHub Actions workflows, and docker-compose files never leave the browser tab.
Tool details
- Input
- Text + Numbers + Structured content
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy + Download
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- No account required
- Open the page and use it; whether results survive refresh depends on the tool.
- Performance budget
- Initial JS <= 25 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Format Converter · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How YAML Formatter & Validator fits into your work
Use it when the main problem is getting content from one practical format into another.
Conversion jobs
- Turning pasted content or local files into a handoff-friendly format.
- Previewing a conversion before you use it in a larger workflow.
- Cleaning small format mismatches without opening a full editor.
Conversion checks
- Try a small sample first when the source format is messy.
- Check character encoding, separators, and line endings after conversion.
- Keep the source until the converted output has been reviewed.
Good next steps
These links move the current task into a more complete workflow.
- 1 YAML ⇄ JSON Converter Convert between YAML and JSON — both directions, pretty-printed, error messages with line numbers — browser-only Open
- 2 JSON Formatter & Validator Format, validate, and minify JSON instantly — right in your browser. Open
- 3 XML Formatter & Validator Pretty-print, minify, and validate XML in your browser — preserves CDATA, comments, and namespaces. Open
Real-world use cases
Stop CI failing on a stray tab in a GitHub Actions workflow
A push fails with "found character that cannot start any token" on line 47 of your workflow. Someone's editor inserted a tab where YAML demands spaces. Paste the file, hit Format with 2-space indent, and the parser flags the exact line, then re-emits the whole document with spaces only. Copy it back and the run goes green.
Make Kubernetes manifests diff-stable before a review
Two engineers edit the same 300-line Deployment and the PR diff is a mess because map keys landed in different order. Turn on Sort keys and format both files: every map is reordered alphabetically, so the only lines that show up in `git diff` are the ones that actually changed, not 40 phantom reorder lines.
Validate a docker-compose file with secrets without uploading it
Your `docker-compose.yaml` holds DB passwords and an API token, so a web validator that POSTs to a server is a non-starter. This runs entirely in the tab, so you can paste the real file, confirm the indentation under `services:` parses, and fix the offending line before `docker compose up` chokes on it.
Minify a config for a curl payload or a one-line annotation
You need to stuff a small YAML config into a Kubernetes annotation or a shell variable where multi-line strings are painful. Click Minify to collapse it to single-line flow style like `{replicas: 3, image: nginx}`, paste it inline, and skip the heredoc gymnastics.
Common pitfalls
Expecting comments to survive: the formatter parses to a plain object first, so a `# pinned for CVE-2024-xxxx` note disappears. Format only comment-free sections, or keep the note outside the formatted block.
Assuming Sort keys keeps anchor names: `&web` / `*web` resolve to inlined values and the textual names are dropped, so format without Sort keys if a downstream tool greps for the anchor literally.
Treating `on:` in a GitHub Actions file as safe under 1.1 habits: in YAML 1.2 it stays a string key, but in 1.1 tooling `on` can coerce to boolean true, which silently renames the key. Quote it as `"on":` to be safe.
Privacy
Everything runs in your browser tab via the eemeli/yaml library compiled to JavaScript. Your YAML is never uploaded, logged, or sent to any server, and the input is not written into the URL, so secrets in `.env.yaml`, Helm values, or docker-compose files stay local. Close the tab and nothing persists.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- 555 Timer Calculator Astable f = 1.44/((R1+2R2)C) + monostable t = 1.1RC — pick R1, R2, C in Ω/kΩ and µF/nF, read frequency, duty cycle and pulse width — browser-only
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only