Docker Compose Formatter & Validator
Beautify or minify docker-compose YAML with clear, line-numbered validation errors — entirely in your browser. Your file never leaves the page.
- Runs in your browser
- No upload, no tracking
- Free forever
How it works
A Docker Compose formatter parses your docker-compose.yml as YAML and rewrites it with consistent 2-space indentation so services, volumes and networks line up correctly — at the same time validating the file and reporting any syntax error with its line number and a fix hint. It works on any YAML, including Kubernetes manifests and CI configs, and runs entirely in your browser so secrets never leave your machine. It is built by JusDB, a managed database operations team, for the infrastructure files that sit alongside your databases.
- 1
Paste your Compose file
Drop a docker-compose.yml, a Kubernetes manifest or any YAML into the input panel.
- 2
Choose Beautify or Minify
Beautify re-indents the file with clean 2-space indentation; Minify collapses it to the most compact valid YAML.
- 3
Read inline errors
If the YAML is invalid, the output shows a plain-language summary, the line number and a concrete hint so you can fix it fast.
- 4
Copy the result
Copy the formatted YAML to your clipboard with one click. Nothing is ever uploaded.
Frequently asked questions
- Does it validate my Compose file?
- Yes. The file is parsed as YAML and any syntax error is reported with a plain-language summary, the line number, and a concrete hint on how to fix it.
- What do Beautify and Minify do?
- Beautify re-indents the file with consistent 2-space indentation for readability. Minify collapses it into the most compact valid YAML, useful for embedding or diffing.
- Does it work with any YAML, not just Compose?
- Yes. It formats and validates any valid YAML document, so it works for docker-compose.yml, Kubernetes manifests, CI configs and general YAML.
- Is my Compose file uploaded anywhere?
- No. Parsing, formatting and validation all run locally in your browser using js-yaml. Your file — including any secrets it contains — never leaves your machine.
- Does it format as I type?
- Yes. The output re-formats live whenever you edit the input or switch between Beautify and Minify, so you see the result and any error immediately without clicking a button.
- Why does YAML indentation matter for Compose files?
- Docker Compose relies on indentation to express nesting — services, their keys, and lists like ports and volumes. A single misaligned line changes the structure or breaks parsing, which is why consistent 2-space indentation matters.
Writing clean docker-compose files
A Compose file is a single YAML document that wires up a multi-container application. The shape matters: top-level keys like services, volumes and networks each open a mapping, and everything that belongs to a service — its image, ports, environment and depends_on — is nested one indentation level deeper. Because YAML carries no closing brackets, indentation alone defines that nesting, so keeping it uniform is what makes the file both parseable and reviewable.
Consistent formatting makes diffs reviewable
When every contributor re-indents by hand, an unrelated whitespace change can bury the one line that actually matters in a pull request. Normalising to 2-space indentation and stable key ordering means a diff shows only real changes — a new port mapping, a bumped image tag, an added healthcheck — instead of formatting noise. That is also why running the same formatter before each commit keeps a shared docker-compose.yml calm over time.
If you frequently move the same configuration between YAML and JSON tooling, the YAML & JSON converter pairs naturally with this formatter for round-tripping config.
Pitfalls that quietly break Compose
A handful of mistakes account for most broken Compose files. Port mappings are a classic trap: a value like "8080:80" should be quoted, because an unquoted >sexagesimal<-looking pair such as 22:22 can be parsed as a number rather than the "host:container" string you intended. Environment values that contain a $ also surprise people — Compose performs variable interpolation, so a literal dollar sign must be written as $$. Finally, the top-level version: key is obsolete on modern Compose and now only emits a warning; new files should simply omit it.
Composing databases for local development
The most common reason to reach for Compose is standing up a database next to your app. Whether you run Postgres, MySQL, MongoDB or Redis, two patterns keep local data sane. First, attach a named volume (for example a volumes entry mounted at the engine's data directory) so your rows survive a docker compose down and rebuild. Second, give the database a healthcheck and have your app depend on it with depends_on using a condition — pairing the service with condition: service_healthy means your application waits for the engine to actually accept connections, not merely for the container process to start.
Getting that readiness sequencing right locally mirrors what matters in production, which is the day-to-day work behind our managed databases.
Everything here runs client-side: your Compose file — connection strings, passwords and all — is parsed and reformatted in the browser and is never uploaded, so it is safe to paste a file that still holds real secrets.