Skip to content
QKQuickKit日本語
Kubernetes & IaCLOCALRuns in your browserInput may contain sensitive information

HCL Indentation Formatter

Normalize indentation for a bounded HCL native-syntax snippet while preserving strings, comments, and heredoc text.

This tool handles input and primary processing in your browser and is designed not to send the input to QuickKit’s server.

Avoid live production secrets; use dummy or masked data where possible. Data handling details

Indented output

How it works

This is deliberately a structural indentation formatter, not a full HCL parser and not terraform fmt. It recognizes quoted strings, line and block comments, heredocs, template sequences (${ … } and %{ … }) inside strings and heredocs, and balanced braces, brackets, and parentheses, then applies two-space indentation. A heredoc starts only at <<ID or <<-ID outside strings and comments with nothing after the identifier on that line, and closes only at a marker line in its own body, not inside ${ … }, as in HCL. Lines that start in heredoc text or inside a block comment are kept as written. A line that starts inside a multi-line ${ … } or %{ … } is code, even in a heredoc: it is re-indented, one level per open sequence as in hclwrite, and heredoc text after its closing } is kept as written. It does not align equals signs, parse HCL expressions/templates, validate Terraform semantics, or promise canonical Terraform formatting. Input is capped at 128 KiB and 4000 lines. For canonical production formatting, run the target Terraform version's terraform fmt and then terraform validate.