YAML Input

Minified Output

What is YAML Minifier?

Need a YAML file on one line, or just smaller? The YAML Minifier rewrites your YAML (YAML Ain't Markup Language) in flow style: {subscribers: [{subscriberId: SUB-1001, plan: Unlimited 5G}]}. All indentation and line breaks between keys disappear. It's the same idea as minification for JavaScript or CSS: smaller text, same data.

Flow style is part of the YAML specification, so any YAML parser reads the output and gets the same keys and values back. Big integers keep every digit and unquoted dates like 2024-01-15 stay as written. Files with several --- documents keep them, one flow line each. What you lose: comments, blank lines, and anchors (aliases are expanded into copies).

Everything happens in your browser, so your YAML never leaves your computer. The savings pill above the output shows the real byte difference for your file.

How to Use the YAML Minifier

Paste, check the savings, copy.

1

Paste, Upload, or Load Sample

Paste YAML into the left panel, or click Upload to load a file. Click Sample to see example telecomm subscriber YAML. Example:

subscriber:
  subscriberId: SUB-1001
  plan: Unlimited 5G
  dataUsage: 45.2
  status: active
  carrier: Verizon
2

View Minified Output

The right panel shows the minified YAML, one flow-style line per document, and the pill above it shows how many bytes that saved. Invalid YAML shows the parser error instead.

3

Download or Copy

Click Download to save the minified .yaml file, or Copy to copy to clipboard. Use Clear to start fresh. All processing runs in your browser.

When You'd Actually Use This

Production Deployment

Collapse a config onto one line so it fits inside an env var, a command-line flag or a --set-json-style argument — places where quoting multi-line YAML is miserable.

API Optimization

Paste a short YAML snippet into a chat message, ticket or log line without the indentation getting mangled on the way.

Storage Efficiency

Compare two YAML files structurally: minify both and the differences show up on one line each, without indentation noise.

Network Transfer

Shrink YAML test fixtures or seed data checked into a repo when nobody reads them by hand. For anything humans edit, keep the readable version.

Common Questions

Is my YAML data stored?

Nope. Everything happens right in your browser. Your YAML never leaves your computer – we don't even see it.

Does minification break my YAML?

No. Flow style is standard YAML, so keys, values and nesting come back the same when you parse it. Comments are removed, and anchors and aliases are expanded into full copies, so a file that leans heavily on <<: *defaults can actually get longer.

How much smaller does it get?

It depends on how deeply the file is indented and how many comments it has. The sample saves about 15%. Deeply nested Kubernetes or Compose files with comments save more; a file that's already in flow style saves nothing. The pill shows the exact number for your input.

Can I format it back?

Yes. Paste the output into the YAML Formatter to get indented block style back. Comments removed during minification don't come back, so keep your original if they matter.

What about multi-line strings?

Their content is kept exactly, but they're rewritten as quoted strings with \n escapes, because block scalars (| and >) can't live on one line.

Does it work with large files?

A few MB minifies in well under a second. The whole file is parsed in your browser's memory, so for very large files a command-line tool like yq is the better fit.

Other YAML Tools You Might Need

Minification is just one YAML task. Here are other tools that work well together: