CodeConverter

About the Terraform Formatter

The Terraform Formatter applies terraform fmt-style layout to HCL: two-space indentation driven by brackets, aligned equals signs across consecutive attributes, aligned trailing comments, consistent spacing around operators, commas and braces, and a single trailing newline. Heredocs and block comments are never touched.

How to use the Terraform Formatter

  1. Paste your Terraform (.tf or .tfvars) code.
  2. Click Format.
  3. Copy or download the formatted file.

Frequently asked questions

Is the output identical to terraform fmt?

It follows the same layout rules, but it is not verified byte-for-byte against the real binary and a few rare spacing cases may differ. Keep terraform fmt -check in CI as the final authority.

What does it leave alone?

Heredoc bodies, block comments and string contents are never changed, and the formatter reports unbalanced brackets or an unclosed block comment instead of guessing.

Are my data stored when I use the Terraform Formatter?

The text you submit is processed in memory to produce the result and is not saved. Like any web server, Code Converter logs basic visit data (page, IP address and browser) but never the content you paste.

Is the Terraform Formatter free, and can I call it from a script?

It is free and needs no account or signup. The same tool is available as a REST endpoint at POST /api/terraform-format; see the API documentation for the fields and examples.