Categories
YAML Formatter
Format YAML to make it easier to read.
Overview
Formats YAML with broken indentation, or YAML written in flow style ({} or []), into a readable block style.
Useful for keeping YAML configuration files, such as Docker Compose, Kubernetes, or GitHub Actions, readable while editing or reviewing them.
Also handles YAML-specific multi-line strings (block scalars) and flow-style arrays and mappings.
Usage
- 1
Enter the YAML you want to format into the text area.
- 2
Click the "Format" button.
- 3
The result, formatted into a readable style, is displayed below. Use the "Copy" button to copy it to the clipboard.
Example
Input
name: Taro age: 20 hobbies: [reading, coding]
Output
name: Taro age: 20 hobbies: - reading - coding
Use Cases
Fixing a YAML configuration file whose indentation got messed up through manual editing or another tool's output
Converting flow-style YAML into a block style that is easier to review
Formatting a YAML file into a readable style before including it in a code review or documentation
FAQ
Is the YAML I enter sent anywhere?
No. All formatting happens entirely in your browser and is never sent to an external server.
What happens if I enter invalid YAML?
An error message "The YAML format is invalid." is displayed. Check for inconsistent indentation and similar issues.
Can flow-style input (using {} or []) also be formatted?
Yes. Flow-style input is also reformatted into a readable block style.
Notes
Entering syntactically invalid YAML, such as with inconsistent indentation, results in an error.
Comments (lines starting with #) may not be preserved in the formatted result. We recommend keeping a note of important comments before formatting.
Formatting very large YAML data may make browser processing slow.
Related Tools
Validate whether YAML syntax is correct.
Convert JSON into YAML format.
Validate whether JSON is correctly formatted.