.env · transform

ENV to YAML

Convert .env files to YAML, GitHub Actions env blocks, or docker-compose environment maps. 100% client-side.

Be the first to rate
DATABASE_URL: "postgres://user:pass@localhost:5432/app"
PORT: 3000
DEBUG: true
APP_NAME: My App

What it does

  • YAML map output (straight key/value)
  • docker-compose environment block
  • GitHub Actions env: block
  • Ansible vars file format
  • Quotes preserved for values with special characters

Privacy

Runs 100% in your browser. Your .env never touches our servers.

client-side only

Usage examples

Case 1 · Plain YAML map
DATABASE_URL=postgres://...
PORT=3000
DEBUG=true
DATABASE_URL: "postgres://..."
PORT: 3000
DEBUG: true
Case 2 · docker-compose
NODE_ENV=production
PORT=3000
services:
  app:
    environment:
      NODE_ENV: production
      PORT: 3000
Case 3 · GitHub Actions
NODE_ENV=production
LOG_LEVEL=info
jobs:
  app:
    runs-on: ubuntu-latest
    env:
      NODE_ENV: production
      LOG_LEVEL: info

When to use this tool

  • Promoting local .env to a GitHub Actions workflow env block
  • Filling out docker-compose.yml without retyping keys
  • Generating Ansible / Chef / SaltStack vars from existing .env
  • Converting to Helm values.yaml for a Kubernetes deploy

Common mistakes

  • Pasting into a YAML file that already has a key of the same name — causes silent overrides
  • Forgetting YAML is indentation-sensitive — don't manually edit the indentation
  • Shipping secrets in GitHub Actions YAML to a public repo (use GitHub Secrets instead)
  • Assuming quoted YAML strings will match your app's type coercion — test with your actual parser

Convert .env to YAML Online

Paste a .env and get YAML back — formatted for plain YAML maps, docker-compose environment blocks, GitHub Actions env: blocks, or Ansible vars files. Useful when migrating config from a local .env to infra-as-code.

When to use this

  • Promoting local .env to a CI pipeline (GitHub Actions, GitLab CI)
  • Filling out a docker-compose.yml without hand-typing keys
  • Ansible / Chef / SaltStack vars files
  • Helm chart values.yaml for a Kubernetes deploy

Frequently asked questions

Which YAML output formats are supported?

Four formats: (1) a plain YAML map, (2) a docker-compose environment block, (3) a GitHub Actions env: block, and (4) an Ansible vars file. Switch between them with the format selector.

Are special characters in values handled correctly?

Yes. Values containing colons, quotes, newlines, or YAML special characters are automatically quoted or block-scoped to produce valid YAML output.

Are comments from the .env included in the YAML?

Yes. Block comments (# comment) are converted to YAML comments and placed above the corresponding key group.

Is the YAML output safe to paste directly into a GitHub Actions workflow?

Yes, with one caveat: if your .env contains actual secret values, paste them into GitHub Actions Secrets instead of hardcoding them in the workflow YAML. Use the YAML output to identify which keys to add as secrets, then reference them as ${{ secrets.MY_KEY }} in the workflow.

Related tools

Learn more

Compare

coming soon

Get notified when env syncing launches

We're building a tiny tool to keep .env files in sync across teammates and environments. Leave your email — no spam, just a single launch ping.