ENV to YAML Converter — Free Online

.env to YAML Converter

Paste a .env file and get the same settings as nested YAML — handy when moving configuration into Docker Compose, Kubernetes, Helm values or an application config file. Conversion runs in your browser; your secrets are never uploaded.

How the conversion works

  • Each KEY=value line becomes an entry. Blank lines and lines starting with # are skipped, and inline comments (URL=http://x # note) are stripped.
  • export KEY=value is accepted — the export prefix is removed.
  • Quoted values may span several lines. Single quotes are literal; double quotes understand \n, \t, \" and \\.
  • Numbered keys become lists: APP_SERVERS_0 and APP_SERVERS_1 give a servers list, so YAML to .env and back round-trips.
  • Nothing is silently lost. If a name is both a value and a prefix (APP=1 and APP_NAME=x), app_name is kept as a flat key, and lines without = are reported as # warning: comments at the top of the YAML. The Options bar sets nesting, key case and type inference.
  • Underscores become nesting and keys are lowercased: APP_NAME and APP_PORT become name and port under app.
  • Surrounding quotes are removed.
  • Values stay strings. .env files have no types, so 8080 is written as '8080'. Remove the quotes in the YAML if your consumer needs a number.

Example

# comment
APP_NAME=demo
APP_PORT=8080
DB_URL="postgres://u:p@h/db"
export DEBUG=true

becomes

app:
  name: demo
  port: '8080'
db:
  url: postgres://u:p@h/db
debug: 'true'

When nesting is not what you want

Splitting on _ suits names such as DB_HOST and DB_PORT, which share a prefix. A name like MAX_UPLOAD_SIZE turns into three levels (max.upload.size). If you need flat keys — for a Kubernetes env: list or a ConfigMap — keep the variable names as they are and build the list by hand, or edit the nested output.

Handle secrets carefully

.env files often hold passwords and API keys. Conversion happens locally, but the YAML you produce is just as sensitive: keep it out of version control, and use your platform's secret store (Kubernetes Secrets, Docker secrets, a vault) instead of plain config.