Docker Compose formatter
Processed in your browser · nothing is uploaded
Reindents a `docker-compose.yml` to two spaces per level and reports the line where it fails to parse — which for Compose is almost always an indentation problem.
How to use the docker compose formatter
Compose files are YAML, so indentation is not style, it is structure. A service nested one level too deep becomes a key of the service above it, and the error Compose reports is about an unexpected field rather than about indentation — which sends people looking in the wrong place entirely. Quoting ports is the other recurring problem, and it is the YAML sexagesimal rule. An unquoted `22:22` is parsed as a base-60 time value, not as a port mapping, so it becomes the number 1342. Any port mapping should be quoted, which is why the Compose documentation quotes them even in examples where it does not strictly matter. Environment values have a similar trap: `DEBUG: true` is the boolean true, while a container expects the string `"true"`. Compose converts it, but a value like `VERSION: 1.10` becomes 1.1, and `ENABLED: no` becomes false. Quote anything that is meant to reach the container as text.
Questions
Almost always indentation — a service nested one level too deep becomes a key of the service above it.