DeveloperKit

YAML Formatter & Validator

Format and validate YAML online, comments included. Free, instant, and 100% in your browser.

Input YAML

1 lines · 0 B

Output

Formatted YAML will appear here.

What is a YAML Formatter?

YAML is the language of configuration: Kubernetes manifests, Docker Compose files, CI/CD pipelines, Ansible playbooks, and many application settings are written in it. Because YAML uses indentation for structure, a single misplaced space can break a file or silently change its meaning.

This YAML formatter checks your file for errors and re-indents it consistently. Unlike many converters, it keeps your comments, so you can safely format files you commit to version control.

Features

  • Consistent indentation

    Re-indents every mapping and list with 2, 3, or 4 spaces, so the structure is easy to read.

  • Keeps your comments

    Comments, blank lines between entries, anchors, aliases, tags, and quoting styles are preserved.

  • Precise validation

    Bad indentation, tabs, duplicate keys, undefined aliases, and unclosed quotes or brackets are reported with line and column.

  • Real-world YAML

    Handles Kubernetes manifests, Docker Compose files with merge keys (<<), GitHub Actions workflows, and multi-document files.

  • Tree view

    Explore the parsed data, with aliases and merge keys resolved, in a collapsible tree.

  • Private by design

    Everything runs locally in your browser. Your YAML, including any secrets, is never uploaded.

YAML Formatting Example

Inconsistent YAML
server:
     host: localhost   # local only
     ports:
     - 80
     - 443
     tls: {enabled: true}
Formatted YAML
server:
  host: localhost # local only
  ports:
    - 80
    - 443
  tls: {enabled: true}

The indentation is normalized, and the comment and flow mapping are kept.

How to Format YAML Online

  1. Paste your YAML into the Input editor, or upload or drop a .yaml or .yml file.
  2. The tool validates it instantly and shows any error with its line and column.
  3. Choose Beautify and your indentation, or Minify for a single line.
  4. Copy the result or download it as a .yaml file.

Frequently Asked Questions

Does the formatter keep my comments?

Yes. Beautify keeps comments, blank lines between entries, anchors (&), aliases (*), tags (!), quoting styles, and block scalars (| and >). Only the indentation changes. Minify writes each document on one line in flow style, which removes comments.

What are the most common YAML errors?

Inconsistent indentation, tabs used for indentation, a missing space after the colon (key:value), duplicate keys, a nested mapping on the same line as its key (a: b: c), and unclosed quotes or brackets. Each one is reported with its exact line and column.

Why are tabs not allowed?

The YAML specification only allows spaces for indentation, because tabs can be displayed with different widths and make the structure ambiguous. Replace tabs with spaces.

Which YAML version is supported?

YAML 1.2 with the core schema: true and false are booleans, and values like yes, no, or on stay text. Merge keys (<<), widely used in Docker Compose, are also supported. Explicit complex keys (? key) are not supported.

Is my YAML uploaded anywhere?

No. Parsing and formatting run entirely in your browser. Your YAML never leaves your device, which makes it safe for configuration files that contain secrets.

  • YAML to Base64

    Encode YAML as Base64 for Kubernetes Secrets, CI variables, and config values.

  • Base64 to YAML

    Decode Base64 strings, such as Kubernetes Secret values, back into readable YAML.

  • JSON to YAML

    Convert JSON to clean, readable YAML for Kubernetes, Docker Compose, CI pipelines, and config files.

  • XML to YAML

    Convert XML documents and configs into clean, readable YAML.