# YAML Formatter > Free in-browser YAML formatter and validator. Format YAML with 2 or 4 spaces, or minify it to flow style. Validate against YAML 1.2 with exact line and column errors. Convert YAML to JSON and JSON to YAML. No signup, no upload. - [YAML Formatter](https://lab.awaara.cn/yaml-formatter/): format messy YAML with 2 or 4 spaces, or minify it to flow style. The validator checks YAML 1.2 and reports the exact line and column of each error, catches duplicate keys and tab indentation, warns about the YAML 1.1 boolean trap (on, off, yes, no as keys or values), resolves anchors, aliases and merge keys, and converts between YAML and JSON. Free, runs in your browser. ## Features - Format: re-indent YAML with 2 or 4 spaces, sort keys A to Z, keep numbers exactly as written (1.30 stays 1.30, big integers stay whole) - Minify: print the whole document in flow style, one line per document - Validate: exact line and column errors for tabs, unclosed quotes, duplicate keys, undefined aliases, plain scalars that contain a colon and a space, and unclosed flow collections - Warnings: YAML 1.1 boolean words (on, off, yes, no, y, n) as keys or values, with the GitHub Actions on: trap explained - Convert: YAML to JSON (large integers kept whole, hex and octal numbers printed as values) and JSON to YAML (duplicate keys reported) - Samples: Kubernetes Deployment and GitHub Actions workflow, one click to load - Multi-document files (--- separators), block scalars (| and >), comments, anchors, aliases and merge keys - File upload for .yaml and .yml, up to 2,000,000 characters ## Limits - Comments are not kept when formatting: the formatter prints the file again from the parsed data. Use Validate only to check a file without changing it. - Tags such as !!str and explicit ? keys are rejected with a clear error instead of guessed at. - Flow collections must fit on one line. ## Use it - Web: https://lab.awaara.cn/yaml-formatter/ - Paste YAML, pick an indent and an output mode, press Format. Or press Validate only to check without changing the input. ## Source - YAML 1.2 Specification: https://yaml.org/spec/1.2.2/ - GitHub Docs, Workflow syntax for GitHub Actions: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax