Validate Terraform Online — HCL Syntax Checker

Live HCL syntax validation with line numbers. Syntax only — not terraform validate or provider checks.

Loading…
Terraform validator — syntax-only checker
Catch unclosed braces and malformed blocks while editing HCL — ideal for quick feedback before running terraform validate in CI.

Developer notes

• Validates HCL grammar only — not resource types, variables references or state. • Debounced ~300 ms after typing stops. • Empty input shows idle state (not “invalid”). • Use format-terraform after fixing syntax errors.

When teams pick this route

• Sanity-check a pasted module fragment in a ticket or chat. • Find the exact line of a brace typo without opening the IDE. • Validate .tfvars-style HCL snippets that are not full modules. • Teach HCL structure with immediate feedback.

Worked examples

Valid provider + resource skeleton

Input

terraform { required_version = ">= 1.5.0" required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } } } resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" }

Validation result

Valid HCL syntax — no errors.

Unclosed block (common copy-paste mistake)

Input

resource "aws_instance" "web" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t3.micro" tags = { Name = "web"

Validation result

Invalid — parse error with line number near the missing closing brace.

Navigate related DevOps tools

Format fixed HCL with format Terraform, or explore minify Terraform and the DevOps hub.

HCL validator FAQ

Syntax only

Same as terraform validate?

No — this checks HCL grammar only. Provider schemas and graph validation require the Terraform CLI.

Does it check .tfvars files?

Yes, if the content is valid HCL syntax. It does not evaluate variable values against modules.

Why debounced validation?

To avoid parsing on every keystroke while keeping feedback under ~500 ms after you pause typing.

Looking for converters, encoders, formatters, and minifiers in one place? Developer tools hub Open the curated developer tools catalogue.