Skip to main content
Developer
New

YAML Formatter

Beautify and compact simple YAML in your browser. Normalize indentation for maps and lists - no upload required.

YAML Input

Paste YAML below.

No YAML yet

Paste YAML above or load the example to format or minify.

Was YAML Formatter helpful?

Stored locally for now - helps us improve this tool.

Why people trust ToolMint

Free utilities designed for privacy, speed, and everyday reliability.

  • 100% Free

    Core tools stay free with no paywall to unlock basics.

  • No Registration Required

    Open a tool and start immediately - no account needed.

  • Privacy First

    We avoid unnecessary collection and keep processing local when possible.

  • Browser Processing

    Most tools run in your browser so your input never needs a server round-trip.

  • Fast & Secure

    HTTPS everywhere with instant, client-side results for everyday tasks.

  • Mobile Friendly

    Layouts and controls are built for phones, tablets, and desktops.

  • Updated Regularly

    Tools and content are improved continuously as the platform grows.

Tool statistics

Local visit data for this browser only.

Opened
Last used
Favorite
Category
Developer
Version
1.0.0

Key Features

  • Consistent Two-Space Indentation

    Detects the smallest indentation used in your document and renormalizes every nested key and list item to a clean two-space step.

  • Tabs & Mixed-Indent Detection

    Flags files that mix tabs and spaces, or that use inconsistent indentation jumps, before they cause a confusing parser error elsewhere.

  • Comment-Preserving Format

    Keeps # comments attached to their original line so annotated Kubernetes manifests and CI configs stay documented after reformatting.

  • Advanced-Syntax Guardrails

    Detects anchors, aliases, tags, flow collections, and block scalars and tells you plainly when a document needs a full YAML parser instead.

How to Use

  1. 1

    Paste your YAML

    Copy config from a Docker Compose file, Kubernetes manifest, GitHub Actions workflow, or application settings file.

  2. 2

    Choose Format or Minify

    Format normalizes indentation to two spaces per level; Minify joins simple key-value pairs and list items onto a single line.

  3. 3

    Resolve any reported issue

    Tab characters, mixed indentation, or advanced syntax like anchors and flow collections are called out with a specific message.

  4. 4

    Copy or download the result

    Export the cleaned-up YAML to your clipboard or save it as a .yaml file for your repository.

Use Cases

  • Cleaning up copy-pasted Kubernetes manifests

    Manifests copied between documentation, Slack, and a terminal often pick up inconsistent indentation - normalize it before applying with kubectl.

  • Reviewing CI/CD workflow files

    Format GitHub Actions, GitLab CI, or CircleCI YAML pulled from a template so steps and jobs are easy to read before you edit them.

  • Auditing Docker Compose services

    Check that nested service, network, and volume definitions line up correctly after merging changes from multiple contributors.

  • Catching tab characters before deployment

    Some editors silently insert tabs into YAML; catch the mixed-indentation error here instead of during a failed deploy pipeline run.

Examples

Four-space indentation to normalized two-space YAML

A mapping indented with four spaces per level is renormalized to a clean two-space step.

app:
    name: toolmint
    env: production
app:
  name: toolmint
  env: production

Formatted YAML to minified output

Comments and blank lines are dropped and simple entries are joined for compact storage.

# service config
name: api
port: 8080
tags:
  - prod
  - web
name: api port: 8080 tags: - prod - web

Benefits

  • Normalizes inconsistent or copy-pasted indentation to a clean two-space standard automatically
  • Catches tab characters and mixed indentation before they cause a cryptic parser failure
  • Keeps # comments attached to their line so documented configs stay documented
  • Warns clearly when a document uses anchors, aliases, or flow syntax it does not support
  • Runs entirely client-side, so Kubernetes secrets and CI configs never leave your browser

Best Practices

  • Run Format immediately after pasting YAML from chat, docs, or email - those sources often corrupt indentation.
  • Treat a tab-character warning as a hard blocker; most YAML parsers reject tabs in indentation outright.
  • Keep secrets out of pasted YAML even though nothing leaves your browser - screen-recording tools may still capture it.
  • For documents using anchors, aliases, or multi-line block scalars, format them in an editor with full YAML-aware tooling instead.

Common Mistakes

  • Mixing tabs and spaces in the same file, which the YAML specification forbids and this tool explicitly rejects.
  • Assuming this formatter supports the full YAML 1.2 spec - anchors, aliases, tags, and flow collections need a complete parser.
  • Minifying deeply nested configuration and expecting it to remain valid YAML - minify is meant for quick inspection, not redeployment.

Privacy Notice

All indentation analysis, formatting, and minifying happens locally in your browser. Configuration files, including anything containing environment variables or connection strings, are never uploaded to ToolMint servers.

About This Tool

What is this tool?

A YAML Formatter is a browser-based utility for the indentation-sensitive configuration format used by Kubernetes, Docker Compose, and CI/CD pipelines. It detects the existing indentation step in a document, then renormalizes every key and list item to a consistent two-space level, while flagging tabs, mixed indentation, and unsupported advanced syntax along the way.

Why use it?

YAML is whitespace-significant, so a single misaligned key or an accidental tab character can break an entire Kubernetes manifest or GitHub Actions workflow. Reformatting catches those issues immediately and restores consistent structure after copy-pasting config between chat, documentation, and your editor, saving a frustrating debugging session later in a deploy pipeline.

Limitations

This tool supports a simple YAML subset - plain mappings, lists, and scalars. It intentionally rejects anchors (&), aliases (*), custom tags (!), flow collections ({} and []), block scalars (| and >), and merge keys (<<:), since formatting those correctly requires a full YAML parser rather than heuristics.

Frequently Asked Questions

Suggested Articles

Help improve YAML Formatter

Found a problem or missing feature? Tell us - no account required.

Report issue

Request a tool

Last updated:

Share this tool