Skip to main content

Terraform .tfvars Formatter & JSON Converter

New

Format and align Terraform .tfvars files, or convert between .tfvars and terraform.tfvars.json, entirely in your browser.

tfvars formatterterraform tfvars to jsonterraform fmt onlinetfvars converter
Read the guide
Shortcuts:⌘ KSearch

Supports strings, numbers, booleans, null, lists, objects/maps, # // and /* */ comments. Heredocs, functions and expressions are not supported (tfvars files can't contain them anyway). Comments are dropped when converting.

Continue with:

Frequently Asked Questions

Does it match terraform fmt?

It normalizes spacing and aligns equals signs similarly, but terraform fmt remains authoritative.

What syntax is supported?

Strings, numbers, booleans, null, lists, objects, and comments. Heredocs and expressions are not supported.

Are comments kept?

No, comments are removed during formatting and conversion.

Can I use the JSON output?

Yes, save it as terraform.tfvars.json and Terraform loads it automatically.

Related Tools