YAML Validator & Formatter

Runs in your browserDeveloper Tools#YAML#JSON

Validate YAML, convert YAML ↔ JSON and re-indent YAML as you type. Supports multi-document files.

JSON
The result appears here as you type.
How to use, limits & privacy

About YAML Validator & Formatter

Check YAML for errors, convert YAML to JSON and JSON to YAML, and re-indent YAML, all as you type. Errors show the line, the column and the lines around the problem. Files with several documents separated by --- are supported, which suits Kubernetes manifests, Docker Compose files and CI pipelines. It runs in your browser.

How to Use

1

Paste or open your file

Paste YAML or JSON into the left box, drop a file on it, or click Open file. Pasted JSON switches the mode to JSON → YAML by itself.

2

Pick a mode

Choose YAML → JSON, JSON → YAML or Format YAML, and an indent of 2 or 4 spaces. Valid input shows a green Valid chip; errors show where they are and how to fix them.

3

Copy or swap

Click Copy or Download to save the result, or Swap to move the result into the input and convert it back.

Privacy & Processing

  • Mode: local
  • Files Leave Browser: Local tool processing; review details below
  • Max Input Size: Device memory limits
  • Account Required: No
  • Data Stored Locally: Nothing is saved. Older versions kept a draft in this browser; it is deleted when you open the tool.
  • Network Processing: Assets or models may require an initial download

Your YAML and JSON are processed in your browser and are never uploaded.

Rules & Limitations

  • Format YAML and the conversions rewrite the file from its data: comments are removed and anchors (&) and aliases (*) are written out in full. A warning appears when your input has them.
  • YAML 1.2 rules apply: yes, no, on and off stay text, and dates stay text. Merge keys (<<) are expanded.
  • Custom tags such as !!js/function, !Ref or !Sub (AWS CloudFormation) are not supported.
  • Several documents become a JSON list with one item per document. Big whole numbers keep all their digits in both directions.

Top Suggestions

  • Finding the indentation error in a Kubernetes or Docker Compose file
  • Converting a JSON API response to YAML for a config file
  • Checking a GitHub Actions or GitLab CI file before you push
  • Turning YAML into JSON for a tool that only reads JSON

YAML Validator & Formatter FAQ

How do I validate a YAML file?

Paste it into the YAML box or click Open file. If it is valid you see Valid YAML and the number of documents; if not, the error box shows the line and column and the lines around the problem.

Why does my YAML say bad indentation?

Items at the same level must start in the same column, and YAML does not allow tabs for indentation. Look at the line shown in the error and the line above it, and use spaces only.

Does converting keep my YAML comments?

No. JSON has no comments, and Format YAML rebuilds the file from its data, so comments are removed and anchors are expanded. Keep the original if you need them.

What is the difference between YAML and JSON?

They hold the same kinds of data. YAML uses indentation and allows comments, so people use it for config files; JSON uses brackets and quotes and is what most APIs send. Every JSON file is also valid YAML.

Is my YAML uploaded anywhere?

No. Validation and conversion run in your browser, so files with passwords or keys never leave your device. Nothing is saved.