Online Tool Store Online Tool Store

Terraform HCL Formatter

Terraform HCL Formatter tidies a pasted snippet; terraform fmt -check in CI is what keeps a repository formatted. Runs entirely in your browser with no upload.

🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.

Developer

Terraform HCL Formatter

Ready

Frontend preview — no upload or external service.

Formatted HCL

A resource block reindented to two spaces with the equals signs in each argument group vertically aligned, matching terraform fmt byte for byte.

How the Terraform HCL Formatter works

  1. Paste the HCL — a resource block, a module, or a whole file.
  2. Format to the canonical style, which aligns the equals signs within each group of consecutive arguments.
  3. Copy it back, and add terraform fmt to your pre-commit hooks so it stays formatted.

FAQ

Is this the same as terraform fmt?

It applies the same canonical rules — two-space indentation and aligned assignments within argument groups. For authoritative results in CI, run terraform fmt -check, which is the tool your pipeline should trust.

Why are the equals signs aligned?

It is the canonical HCL style, and it makes an argument list far easier to scan. Alignment resets at a blank line or a nested block, which is why one long block can have several alignment groups.

Does formatting validate the configuration?

No. Formatting only fixes layout. Use terraform validate for syntax and reference checking, and a plan to see what would actually change.

How we compare

FeatureOnline Tool StoreA CLI scriptAn IDE plugin
Canonical alignment
Nothing uploaded LocalDepends
No install
Runs in CI Use terraform fmt

Terraform HCL Formatter tidies a pasted snippet; terraform fmt -check in CI is what keeps a repository formatted.

Explore related tools

Embed this tool

Paste this on your own site — it stays free, and every file still stays in your visitor's browser, not yours or ours.