AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
Format and sort HCL code — indent blocks, align equals, reorder resources, variables, and modules
Paste HCL and click Format & Sort
Blocks
0
Sorted
-
Changed
-
Lines
0
The Terraform HCL Formatter goes beyond basic formatting by also sorting blocks alphabetically within your configuration. Well-organized Terraform code follows consistent conventions: resources are grouped and sorted, variables are listed alphabetically, and modules are organized in a predictable order. This tool applies two key transformations: formatting (indentation, alignment, whitespace) and sorting (block ordering for resources, variables, outputs, and modules). It helps teams maintain consistent code organization across projects, makes pull requests easier to review, and reduces merge conflicts. When enabled, the sort feature reorders blocks while preserving their internal structure, ensuring your configuration follows a logical, predictable arrangement.
Is my data sent to a server?
No. All processing is performed locally in your browser. Your HCL data never leaves your device.
What is the difference between this and the Terraform Formatter tool?
This tool adds block sorting, while the basic Terraform Formatter only handles formatting. Use this tool when you need to reorganize your configuration files.
How does block sorting work?
Blocks are sorted alphabetically by type first (data sources, locals, modules, outputs, providers, resources, variables), then by name within each type.
Can I disable sorting and only format?
Yes. Uncheck the Sort blocks option to apply formatting without changing block order.
Is this tool free to use?
Yes. This tool is completely free with no usage limits or registration required.
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026