YAML validator and formatter

Paste YAML from a Docker Compose file, a GitHub Actions workflow, a Kubernetes manifest or any config file. The validator checks it as you type, explains each error in plain words with the line and column, and warns about values that other tools may read differently. Valid YAML is converted to JSON or cleanly formatted YAML. Nothing is uploaded.

Free · No sign-up

Paste YAML, open a file or load an example. It is checked as you type.

Result
Convert to

    
Indentation

Parsing by js-yaml (MIT).

How to use it

  1. Paste your YAML, open a .yaml or .yml file, or load one of the examples.
  2. Read the status under the box. Valid YAML shows the number of keys and documents; an error shows the line, the column and what to fix.
  3. Click Show in input to jump to the error, and check the hints for values such as yes or 0755 that other tools may read differently.
  4. Choose JSON or formatted YAML, pick the indentation, and copy or download the result.

Why use this tool

Exact error location

Every error shows the line and column, a snippet with a pointer, and a plain-language explanation.

Hints beyond syntax

Flags yes and no, leading zeros, version numbers and missing spaces after colons before they cause bugs.

YAML to JSON

Convert valid YAML to JSON with 2 or 4 spaces or in compact form. Several documents become a JSON array.

YAML formatter

Re-indent messy YAML consistently and sort keys alphabetically.

Ready for real configs

Works with Docker Compose, GitHub Actions, Kubernetes, Ansible and OpenAPI files, including --- separated documents.

Private

Validation runs in your browser, so secrets in your configs are never uploaded.

The most common YAML errors

ErrorCauseFix
Bad indentationA key or list item has more or fewer spaces than its neighboursLine up items at the same level with the same number of spaces
Tabs in indentationThe line is indented with a tabReplace tabs with spaces
Duplicate keyThe same key appears twice in one mappingRemove or rename one of them
Missing space after colonkey:value is written without a spaceWrite key: value
Colon inside a valueA value such as Note: important contains ": "Put the value in quotes
Unclosed quote or bracketA " ' [ or { is opened but not closedAdd the closing character

Values that surprise people

YAML guesses the type of unquoted values. In YAML 1.1, used by PyYAML, Ansible and many older tools, yes, no, on and off become true or false, so a country code like NO for Norway turns into false. Numbers with leading zeros such as 0755 may be read as octal, and a version like 1.10 becomes the number 1.1.

This validator follows YAML 1.2, which is stricter, and warns you about these values. The safe rule: put quotes around anything that must stay text, such as versions, codes, phone numbers and postal codes.

YAML vs JSON

YAMLJSON
CommentsYes, with #No
StructureIndentationBraces and brackets
QuotesUsually optionalRequired for keys and text
Several documents in one fileYes, separated by ---No
Typical useConfig files written by peopleData exchanged between programs

Privacy

Config files often contain passwords, tokens and internal hostnames. This tool parses your YAML in your browser with the open-source js-yaml library and never sends it anywhere. Your last input is kept in this browser only, so it is still there when you come back.

Frequently asked questions

How do I check if my YAML is valid?

Paste it into the box above. The status line tells you at once whether it is valid. If not, it shows the line and column of the first error and what to change.

Why does my YAML say bad indentation?

Items at the same level must start at exactly the same column. Usually one line has an extra or missing space, or a list item is not lined up with the ones above it.

Can I use tabs in YAML?

No. YAML only allows spaces for indentation. Pressing Tab in this editor inserts two spaces for you.

Does it check Kubernetes or Docker Compose rules?

It checks YAML syntax and common pitfalls, not the schema of a specific tool. A file can be valid YAML but still have a misspelled Kubernetes field.

How do I convert YAML to JSON?

Paste valid YAML, keep JSON selected on the right and click Copy result or Download. A file with several --- documents becomes a JSON array.

Are comments kept when formatting?

No. Formatted YAML and JSON are rebuilt from the data, so comments and anchors are not kept. Your original text in the left box is unchanged.

Related tools

Need something built?

Tell us what you want to create.

Tell us what you need built, from a simple website to a complete app, AI solution, automation, or custom system.

Tell us what you want to build. We review every enquiry and reply by email.

Contact

Thanks, your enquiry is on its way.

We will review the details and reply by email.