Skip to content
Free tool

YAML Validator: Check YAML syntax online

Use the YAML Validator to check files such as docker-compose.yml, Kubernetes manifests, or CI workflows for syntax errors online. The tool shows errors with line and column numbers and outputs valid YAML with normalized formatting or as JSON, even for multiple documents separated by ---.

Built by Jakub Martyniak

Free, with no sign-up required—your YAML is checked only in your browser and is not uploaded.

Deploying a Kubernetes manifest? Run your containers with full root access.

Input

Result

Paste YAML on the left to see a preview.

Example result

What the result looks like in the YAML Validator

You paste YAML, and the tool reports syntax errors with their line and column or outputs valid YAML in normalized form or as JSON. The two examples below are fixed sample files; your result depends on your file.

Example · Validate and convert to JSON

Input: line 2 indented with a tab

config.yml
server:	name: zap

Output: findings

  • 1 error
  • Error · Line 2, column 1Tabs are not allowed as indentation

    YAML only allows spaces for indentation. Replacing the tab with two spaces makes the file valid.

Input: valid YAML

config.yml
server:  name: zap  port: 25565  tags:    - eu    - ddos

Output: JSON

config.json
{  "server": {    "name": "zap",    "port": 25565,    "tags": [      "eu",      "ddos"    ]  }}

How it works

How to check YAML online with the YAML Validator

Five steps from pasted YAML to a validated file or JSON.

  1. Step 1

    Paste YAML

    Paste your YAML into the input field, open a .yaml or .yml file using “Choose file”, or start with “Load example”.

  2. Step 2

    Select mode

    Select “Validate” or “Convert to JSON” above. For JSON, choose the indentation: 2 spaces, 4 spaces, or tabs.

  3. Step 3

    Read result

    Validation runs automatically as you type. In “Validate” mode, the right side shows “Valid YAML.” or a list of errors with line and column numbers and, for multiple documents, the document number.

  4. Step 4

    Fix error

    Fix the reported issues in the input field. The result updates with every change.

  5. Step 5

    Copy or download

    Copy the normalized YAML or JSON, or download it as validated.yaml or converted.json.

Why this tool

YAML checker and YAML-to-JSON converter in one

Here’s what the YAML Validator can do right in your browser.

Multiple documents in one file

Documents separated by ---, such as Kubernetes manifests, are checked individually. Errors also include the document number.

Errors with line and column numbers

Syntax errors appear with a message and, where the parser can determine the location, a line and column number. Up to 200 errors are listed individually.

Detect duplicate keys

If a key appears twice in one mapping, the tool reports it as an error with its position.

Convert YAML to JSON

In the “Convert to JSON” tab, valid YAML is converted to JSON with 2 spaces, 4 spaces, or tabs for indentation. Download it as converted.json.

Normalized output with comments

Valid YAML is displayed with updated indentation, and comments are preserved. Copy the result or download it as validated.yaml.

Runs only in the browser

Validation and conversion run in your browser, and files are read locally. Your YAML is not uploaded.

Troubleshooting

Common YAML errors and how to fix them

The YAML Validator detects these errors. The error messages themselves come from the YAML library and are in English.

Tab instead of spaces

server:
	name: zap

YAML only allows spaces for indentation. The tool reports a line indented with a tab, including its line and column number. Replace the tab with spaces.

Duplicate key

server:
  port: 25565
  port: 25566

If the same key appears twice in one mapping, the tool reports “Map keys must be unique” at the second key. Delete or rename one of them.

Unclosed bracket

tags: [eu, ddos

A list in square brackets without a closing bracket makes the file invalid. Close the bracket or write the list as hyphen-prefixed items.

Alias without an anchor

app:
  image: *base

An alias such as *base needs an anchor &base defined earlier in the same document. If the anchor is missing or comes later, the tool reports an error.

Basics

What is YAML, and how does it differ from JSON?

YAML files: .yaml and .yml

YAML is an easy-to-read data format for configuration files, such as those used by Docker Compose, Kubernetes, or CI pipelines. Spaces provide indentation to define the structure, values use key: value pairs, list items start with a hyphen, and comments start with #. The .yaml and .yml extensions refer to the same format; the YAML Validator opens both.

YAML or JSON?

JSON uses curly and square brackets instead of indentation and does not support comments. You can convert valid YAML to JSON in the “Convert to JSON” tab: a single document becomes a JSON value directly, while multiple documents separated by --- become a JSON array. Comments are removed.

Discover more

More tools for your configuration files

FAQ

Frequently asked questions about the YAML Validator

Brief answers about YAML and this tool.

Yes. The YAML Validator is free to use without signing up. You need neither an account nor an installation.

No. Validation and conversion run entirely in your browser, and files selected via “Choose file” are read locally. Your YAML is neither sent to a server nor stored. This is useful for configurations containing passwords or tokens.

Paste your YAML into the input field or open a .yaml or .yml file using “Choose file”. Validation runs automatically as you type, without submitting anything. In “Validate” mode, the right side shows “Valid YAML.” or a list of errors with line and column numbers, plus document numbers if there are multiple documents. Up to 200 errors are listed individually; any others are summarized.

YAML only allows spaces for indentation. If a line is indented with a tab, the tool reports “Tabs are not allowed as indentation” with the line and column number—in the example above, line 2, column 1. Replace the tab with spaces to make the file valid.

Yes. Documents separated by --- are checked individually, as is common with Kubernetes manifests. Errors also identify the document they occur in, and the status shows the number of documents when the YAML is valid. A --- at the end of the file does not count as a separate document.

Switch to the “Convert to JSON” tab and choose 2 spaces, 4 spaces, or tabs for indentation. A single document becomes a JSON value; multiple documents become a JSON array. You can copy the JSON or download it as converted.json.

Yes. In “Validate” mode, the tool displays valid YAML with normalized formatting and indentation, while preserving # comments. Your input remains unchanged. Comments are omitted from the JSON output because JSON does not support them.

No. The YAML Validator checks YAML syntax: indentation, structure, duplicate keys, and aliases without a matching anchor. It does not check whether a docker-compose.yml file or Kubernetes manifest contains the correct fields.

Any more questions?

Contact Support
Building something of your own?

Your app or API needs a reliable server

A ZAP-Hosting VPS reliably puts your application or project online.

4.4/5 Trustpilot32,000+ Active serversSince 2010

No setup. No risk. Online in seconds.

Flexible TermCancel anytimeOnline in 60 seconds

Looking for more tools? View all developer tools