Report

Help us improve this tool

YAML to HCL Converter

Parse YAML and emit HashiCorp HCL blocks for Terraform-style configs from structured data.

O M T

Turn YAML into HashiCorp HCL

Parse YAML and emit HCL blocks suitable for Terraform-style configuration. Nested mappings become nested blocks; lists of objects become repeated block arrays when the structure matches HCL conventions.

Related tools: JSON to HCL Converter, YAML to TOML Converter, and HCL to YAML Converter.

Frequently Asked Questions

What YAML shapes work best?

A top-level mapping with nested objects and lists of homogeneous objects maps cleanly to HCL blocks and block arrays.

Is this valid Terraform?

Output follows the same rules as our JSON to HCL converter. You may still need to rename resource types or add provider-specific syntax before applying with Terraform.

Can I load a file?

Yes. Upload a .yaml or .yml file or paste content; conversion stays local in the browser.