PrettifyPrettify

YAML Validator and Linter

Paste YAML and Prettify checks it in your browser. A syntax error shows the line and column where the parser stopped. Warnings flag values that other YAML tools may read as a boolean. Multi-document files are checked in full.

Result
The result of the check shows here as you paste.
Runs in your browser. Nothing is uploaded.

What the YAML validator checks

You paste YAML into the box, and the validator returns a verdict. A valid file gives a line such as "Valid YAML. Object with 4 keys, 8 levels deep." A broken file gives the parser message with its line and column.

The box checks mappings and lists, which is what configuration files contain. A lone word with no keys, such as "hello", is reported as not valid YAML. The check does not rewrite your text, so your comments and layout stay as you wrote them.

Key features

The validator finds the mistakes that break a YAML file in practice. It also adds lint warnings for problems that parse but cause bugs later.

  • Syntax errors report a line and a column, for example bad indentation of a mapping entry.
  • A tab used for indentation is an error, because YAML does not allow tabs there.
  • A key that appears twice at the same level is reported as a duplicated mapping key.
  • An unterminated quoted string is reported where the stream ends.
  • Unquoted yes, no, on, and off get a warning with the line and column, because YAML 1.1 tools read them as true or false.
  • Anchors (&name), aliases (*name), and merge keys (<<) are supported, so a file that uses them still validates.
  • A date such as 2026-08-04 stays the text you wrote and is not turned into a timestamp.
  • Every document in a stream separated by --- is parsed, and the editor adds a button for each one.

How to validate YAML

Start in the box on this page. It re-runs the check shortly after every edit, so you can fix the text in place. Then continue in the editor for the full list of problems.

  1. Paste your YAML into the box labeled "Paste your YAML", or select "Try an example".
  2. Read the line above the result. A green line means the YAML is valid. A red line gives the message, the line, and the column.
  3. Read the yellow lines under a green verdict. The box lists up to five warnings, each with its line number.
  4. Edit the text in the box and watch the verdict update.
  5. Select "Open in full editor". If the YAML has an error, the button reads "Fix it in the editor".
  6. In the editor, open the Problems panel and select an issue to jump to its line.
  7. For a file with several documents, select Doc 1, Doc 2, and so on in the Documents row.

Worked example: a deployment with two traps

This manifest parses without error, but two values carry a risk. Paste it into the box and the verdict reads valid, followed by two warnings. One names line 9, the unquoted no after hostNetwork. The other names line 15, the unquoted off after value.

Some YAML parsers, including those that follow YAML 1.1, read no and off as the boolean false. Prettify keeps them as text, but a tool that deploys the file may not. Quote both values to keep them as strings. If you remove one space before image, the box reports bad indentation of a sequence entry at line 12, column 10.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
spec:
  replicas: 2
  template:
    spec:
      hostNetwork: no
      containers:
        - name: app
          image: nginx:1.27
          env:
            - name: LEGACY_MODE
              value: off

Common use cases

YAML runs most of the configuration you ship. A quick check before you commit saves a failed pipeline run.

  • Check a Kubernetes manifest or Helm values file before you apply it.
  • Test a GitHub Actions workflow or other CI file before you push it.
  • Find the tab that your editor showed as spaces.
  • Confirm that an anchor and its merge key resolve the way you expect.
  • Look at each document of a multi-document file one at a time.

Schema checks and the Diagram view are Pro

In the editor, JSON Schema validation (Pro) checks a YAML file against a schema and lists every error with its line. The presets include GitHub Actions workflow files, and you can also load a schema from a URL or paste one. The Diagram view (Pro) draws the data as a node graph. Pro costs US$19.99 once, with lifetime access.

Frequently asked questions

Can I validate YAML against a JSON Schema?

Yes, in the editor. Select JSON Schema in the Check group of the toolbar, then pick a preset, enter a URL, or paste a schema. This is a Pro tool.

Why does the validator warn about yes, no, on, and off?

Prettify follows YAML 1.2 and keeps yes, no, on, and off as text. Tools that follow YAML 1.1, such as PyYAML, read them as true or false, so the file means something else there. Quote the word to make every tool read text.

Why does a single word say "not valid YAML"?

The box checks for a mapping or a list, the shapes that configuration files use. A bare word is technically a YAML string, but it is not a document you would validate, so the box does not accept it.

Are my comments kept?

Validating does not change your text. Comments are not part of the parsed data, so reformatting the document in the editor or converting it to JSON drops them. Keep a copy of the original if you need them.

How large a YAML file can the box check?

The box reads up to 512 KB. A larger file shows its size and sends you to the full editor, which is built for large documents.

Is it safe to paste a Kubernetes Secret or a CI file with tokens?

The parse runs in your browser, and Prettify does not upload your YAML unless you create a share link. There is no server log of what you checked. Still, remove real secrets from anything you plan to share.

Related tools