How to format YAML and XML
Beautify YAML or XML with your preferred indentation, validate syntax, and convert YAML to JSON or JSON to YAML.
1. Paste your document
Paste YAML or XML — or use the sample button to see how formatting works.
2. Pick a mode
Format YAML, format XML, or convert YAML → JSON / JSON → YAML. Choose 2 or 4 space indentation.
3. Validate & copy
Syntax errors are reported with details. Copy the result or send it back to the input for chained conversions.
YAML powers Kubernetes manifests, GitHub Actions, Docker Compose and CI configs — where a single bad indent breaks the deploy. Formatting normalizes indentation and catches errors before your pipeline does. XML remains the format of sitemaps, RSS feeds, SVG and Maven builds. For JSON-only work, the JSON Formatter adds a collapsible tree view, and JSON Diff compares two documents.