Docker Compose Formatter

Neatly tidy docker-compose YAML.

Category: Dev Tools

When to use?

Use it to consistently align the indentation and array notation of docker-compose.yml.

How to use

  • Paste the Compose YAML.
  • It parses the YAML.
  • Copy the tidied YAML.

Input Explanation

Enter docker-compose YAML with services, volumes, networks, etc.

Calculation Basis

It uses a Prettier YAML parser to re-output indentation and line breaks consistently.

Usage Examples

  • Tidy Compose config - Tidy a local development compose file.
  • Quick pre-deploy check - Check inputs and output to reduce errors before dev/ops work.
  • Aid docs/reviews - Copy the result into dev docs, issues, or review comments.

Examples

  • Tidy the services.app.ports array
  • A docker-compose.yml with scrambled indentation → standard 2-space indentation

Cautions

  • Generated output is for reference; test carefully before production use.
  • Tidying runs only in the browser and config is not sent out.

FAQ

Does it report YAML syntax errors?

If the YAML cannot be parsed, it shows an error message.

Is the pasted compose file sent out?

No. Tidying runs only in the browser, so config is not sent out.

Does the order of services/volumes change?

It keeps the item order and only tidies indentation and spacing to a standard format.

Does it work regardless of compose version?

It tidies indentation for any YAML regardless of version, though a file with broken indentation may not tidy.

Related Tools

  • Dockerfile Formatter - Tidy Dockerfile commands and present the structure clearly.
  • YAML Formatter - Tidy a YAML document with consistent indentation and line breaks.
  • .env Sorter - Sort keys in a .env file and find duplicate keys.
  • JSON Formatter - Beautify or minify JSON strings instantly and check for validity errors.
  • UUID Generator - Generate up to 20 cryptographically secure UUID v4 values at once.
  • Password Generator - Generate secure random passwords in the browser by choosing length, character set, and count.