Skip to content
browserutils

Terraform HCL Formatter

Format Terraform configuration files

Terraform HCL Formatter is a free online tool from BrowserUtils that format terraform configuration files. It runs entirely in your browser — your data never leaves your device. No account required.

How to use Terraform HCL Formatter

  1. 1 Paste or type your input into the editor above.
  2. 2 The tool processes your data instantly — right in your browser, with nothing sent to a server.
  3. 3 Copy the result with one click or continue editing your input.

About Terraform HCL Formatter

Free online Terraform HCL formatter. Format Terraform configuration files with terraform fmt-style indentation and alignment. This tool runs entirely in your browser — your data is never sent to a server. Just paste your input, get instant results, and copy with one click. No sign-up or installation required.

Terraform HCL Formatter specs

Runtime
100% client-side (browser)
Cost
Free — no account, no rate limits, no usage caps
Browser support
Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
Part of
299 developer tools on BrowserUtils (100% client-side)

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.
Embed this tool

Copy this code to embed the tool on your website. Adjust the height to fit your layout.

<iframe src="https://www.browserutils.dev/embed/terraform-formatter" width="100%" height="500" frameborder="0" title="Terraform HCL Formatter"></iframe>

Related tools

More Formatters & Beautifiers

View all Formatters & Beautifiers tools