Toolich
Important tasks

100% Local & Secure

All utility tools process your data entirely in your browser. No inputs or files are ever sent to a server.

Dark mode

YAML Formatter

New Tab (Alt+A)

Validate, format, and convert YAML to JSON with real-time error highlighting.

Documentation & User Guide

YAML Formatter & Converter Guide

YAML is the configuration language behind Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks and most CI/CD pipelines. Its indentation-based syntax is easy to read but easy to break: a single misplaced space, a tab character or an unquoted colon can stop a deployment. The YAML Formatter parses your YAML (or JSON), reports the exact line of any syntax error, and re-emits it with consistent indentation. It also converts between YAML and JSON, so you can move a config between tools that expect different formats, or minify it into a single line for an environment variable or API payload.

⚙️ Key Features

  • Validates YAML and JSON as you type and shows the line number of the first syntax error.
  • Converts YAML to JSON and JSON to YAML in either direction.
  • Pretty-prints with 2- or 4-space indentation, or minifies to compact single-line output.
  • Opens .yaml, .yml, .json and .txt files by upload or drag and drop.
  • Side-by-side or stacked layout, adjustable text size, and optional auto-copy of the result.
  • Clear with one-step undo (Ctrl+Z), and your input is kept for the browser tab session.

📖 How to Use

  1. Paste YAML or JSON into the input box, or drop a file onto the upload area.
  2. Choose the output format (YAML or JSON) and the style (Pretty or Minify).
  3. For pretty output, pick 2 or 4 spaces of indentation to match your project's style.
  4. If the input is invalid, read the error message and line number under the input, fix that line, and the output updates immediately.
  5. Copy the result, or turn on Auto-copy to have every valid result copied to your clipboard automatically.
🔒
Privacy & Security:

Parsing, validation and conversion run entirely in your browser using the open-source yaml library. Your configuration files, which often contain hostnames, credentials or internal service names, are never uploaded to a server.

Frequently Asked Questions (FAQ)

Why does my YAML fail with an indentation error?

YAML uses spaces, not tabs, to show nesting, and every item at the same level must start in the same column. Mixing tabs and spaces, or indenting a list item by one space too many, is the most common cause. Re-indenting the reported line and its siblings usually fixes it.

Are comments preserved when I format?

No. The formatter parses your document into data and writes it back out, and YAML comments are not part of the data. If you need to keep comments, use the formatter to find and fix errors, then apply the corrections to your original file.

Will values like yes, no or on change to true and false?

No. The parser follows YAML 1.2, where only true and false are booleans. Words such as yes, no, on and off stay strings, which avoids the well-known problem of a country code like NO turning into false in older YAML 1.1 parsers.

Can I convert a Kubernetes manifest or Docker Compose file to JSON?

Yes. Paste the file, choose JSON as the output format, and copy the result. Multi-document files separated by --- should be converted one document at a time.

What does Minify do for YAML output?

Minified output is written in compact single-line flow style, which is valid YAML and JSON. It is handy for embedding a config in an environment variable, a command-line argument or an API request body.

Assistant & feedback