YAML formatter and validator
Paste YAML to check it and tidy it up. Format lays it out in block style with consistent indentation, keeping comments and multiple documents; Minify turns it into compact flow style that is still valid YAML.
Comments and documents kept
Formatting keeps your comments, and every document of a file with several (separated by ---).
Compact flow style
Minify writes YAML on as few lines as possible, like {name: app, ports: [80, 443]}. It is still valid YAML, and it is not taken for JSON afterwards.
Indentation and key order
Choose 2 or 4 spaces. YAML does not allow tabs, so with the Tab setting YAML is indented with 2 spaces. Sort keys orders every mapping alphabetically.
Kubernetes, Compose and CI files
Paste a Kubernetes manifest, a docker-compose.yml, a GitHub Actions workflow or an Ansible playbook: anchors, aliases and merge keys are kept, multi-line strings keep their | or > style, and a tab or a bad indent is pointed out before you deploy.
Keyboard shortcuts
- Format: Shift+Alt+F (⌥⇧F on a Mac)
- Minify: Shift+Alt+M (⌥⇧M on a Mac)
- Undo: Ctrl+Z (⌘Z on a Mac). Each Format or Minify is a step of its own.
- Find and replace: Ctrl+F (⌘F on a Mac)
Private: nothing is uploaded
Formatting, checking and comparing all happen in your browser. Your documents are saved in the browser's own storage on this computer, not on a server, so they never leave your device.
With your permission, we count anonymous visits (which pages and tools are used), never what you type. See Privacy.
Questions
How do I validate YAML?
Paste it in: it is checked as you type, and any error is underlined and explained with its line number.
Why are tabs not used for YAML?
The YAML specification only allows spaces for indentation, so YAML is always indented with spaces.
Is my data uploaded anywhere?
Your documents aren't: everything runs in your browser, and they are saved on your computer, in the browser's storage for this site. With your permission we count anonymous visits, never their content.