YAML to .env Converter
Paste YAML, get .env — nested keys flattened to UPPER_SNAKE_CASE — copy or download as .env
database.host becomes DATABASE_HOST).You have environment-specific configuration in YAML and need to convert it to .env format for Docker, Docker Compose, or a 12-factor app. Manually flattening nested YAML keys into UPPER_SNAKE_CASE environment variables is tedious.
What This Tool Does
Paste YAML and get .env output instantly. The converter flattens nested YAML keys using underscore separators, converts keys to UPPER_SNAKE_CASE, and properly quotes values that contain spaces or special characters. Download the result as a .env file.
Everything runs in your browser. Your data never leaves your device.
When to Use This
- Docker deployment — convert YAML configs to
.envfiles for Docker Compose - 12-factor apps — transform structured config into environment variables
- CI/CD pipelines — generate
.envfiles from YAML configuration for deployment - Local development — create
.envfiles from YAML-based project configs
How Nesting Works
Nested YAML keys are flattened with underscores:
database:
host: localhost
port: 5432
Becomes:
DATABASE_HOST=localhost
DATABASE_PORT=5432
FAQ
Does this send my data to a server?
No. All processing happens entirely in your browser. Sensitive config values stay on your device.
How are arrays handled?
Arrays are converted to comma-separated values by default. For example, hosts: [a, b, c] becomes HOSTS=a,b,c.