Compare Terraform Files Online
Paste two Terraform configurations. See what was added, removed, or changed — line by line with word-level highlights.
🔒 100% private — runs entirely in your browserLast updated
or try sample data
Paste two Terraform configurations. See what was added, removed, or changed — line by line with word-level highlights.
🔒 100% private — runs entirely in your browserLast updated
or try sample data
Terraform Diff compares two Terraform configuration files (HCL) and shows you exactly which resources, variables, and settings changed. Whether you're reviewing infrastructure changes, comparing environments, or auditing provider upgrades, this tool gives you a clear view of every modification.
Infrastructure as Code demands careful review. A single character change in a Terraform file can provision a larger instance, open a security group, or destroy a database. Comparing HCL files side by side before running terraform plan or terraform apply catches issues early in the review process.
The tool works with HCL (.tf) files, JSON Terraform format (.tf.json), and even terraform plan output. Word-level highlighting shows exactly which arguments changed within a resource block. Everything runs client-side — your infrastructure configurations stay private.
# Before: staging configuration
resource "aws_instance" "web" {
instance_type = "t2.micro"
root_block_device {
volume_size = 20
volume_type = "gp2"
}
tags = {
Environment = "staging"
}
}
# After: production-ready
resource "aws_instance" "web" {
instance_type = "t3.small"
root_block_device {
volume_size = 50
volume_type = "gp3"
encrypted = true
}
tags = {
Environment = "production"
ManagedBy = "terraform"
}
}The diff highlights instance type upgrade, volume changes, encryption addition, and tag modifications at a glance.
# Before
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
# After
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}Major provider version bumps can introduce breaking changes. The diff makes version constraint changes immediately visible.
# Reviewing security changes is critical.
# The diff shows:
# - New HTTPS ingress rule (port 443)
# - Updated description text
# - Any changed CIDR blocks
# Paste both security group configs
# to verify no unintended access changesSecurity group changes affect network access. Always diff these carefully before applying — an open CIDR block can expose services to the internet.
| Gotcha | Why it happens | What to do |
|---|---|---|
| HCL compared against JSON | Terraform accepts both .tf (HCL) and .tf.json, and this is a line-based text comparison, so the two syntaxes differ on nearly every line. | Compare like with like — HCL to HCL, or JSON to JSON. |
| State drift will not appear | This compares configuration files, not Terraform state, so infrastructure changed manually or by another tool is invisible here. | Run terraform plan to detect drift between config and real infrastructure. |
| A small version bump can be a large change | Moving version = "~> 4.0" to "~> 5.0" is one line, but provider major versions rename resources, change argument names, and alter defaults. | Read the provider changelog alongside the diff rather than judging the change by its size. |
Paste your Terraform HCL (or JSON) files into the two panels and click Compare. The tool shows a side-by-side diff with line-by-line comparison and word-level highlighting for modified lines.
Yes. You can paste the text output from terraform plan runs and compare them. This helps identify differences between planned changes across environments or runs.
Yes. Terragrunt HCL files and OpenTofu configurations use the same HCL syntax and are fully compatible with this text-based comparison tool.
Yes. This tool runs entirely in your browser. Your HCL files, including any provider credentials, backend configurations, or infrastructure details, are never sent to any server.
Yes. Compare module source files, variable definitions, or output configurations. The tool handles any HCL text content.