Skip to content

Terraform HCL Formatter

Embed

Paste this where you want Terraform HCL Formatter on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/terraform-formatter/" width="100%" height="500" frameborder="0" loading="lazy" title="Terraform HCL Formatter"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/terraform-formatter/">Terraform HCL Formatter</a> by BrowserUtils</p>

Format Terraform configuration files.Runs in this tab.

Next step

About Terraform HCL Formatter

Free online Terraform HCL formatter. Format Terraform configuration files with terraform fmt-style indentation and alignment. It runs in your browser. Nothing is sent to a server.

Questions

Does this match terraform fmt output?
The formatter follows terraform fmt conventions with 2-space indentation and aligned equals signs within blocks. It handles all standard HCL block types.
What HCL constructs are supported?
The formatter handles resource, data, variable, output, locals, module, provider, and terraform blocks, including heredoc strings and comments.
Can I format OpenTofu or Terragrunt files with this tool?
Yes, since OpenTofu and Terragrunt use HCL syntax, this formatter works with their configuration files as well.
Does the Terraform formatter require Terraform to be installed?
No, the formatter runs entirely in your browser. You do not need the Terraform CLI installed to format HCL configuration files here.

More in Formatters & Beautifiers

All 26 formatters & beautifiers