~/tools / Terraform Formatter
Terraform Formatter
Indent Terraform (HCL) code based on brace depth. A lightweight, browser-based alternative to terraform fmt.
Useful when you don't have a terraform fmt environment handy, or you just got a .tf snippet from someone and want to quickly tidy it up. This does simple brace-depth-based indentation.
# Use Cases
- Reading a .tf snippet shared in Slack or a ticket by quickly re-indenting it
- Tidying up indentation when you don't have the terraform CLI available
- Cleaning up messily-indented HCL before a PR review
# Usage
- Paste the Terraform (HCL) code you want to format.
- Click "Format" to indent it based on brace depth.
# FAQ
- Does this produce the exact same result as terraform fmt?
- No. terraform fmt does a proper HCL parse; this tool does simple brace-depth indentation. For complex expressions or comment alignment, use the official terraform fmt command.
- Is this an official HashiCorp tool?
- No, this is an independent, unofficial formatter. Terraform is a trademark of HashiCorp, Inc.