.env Converter

.env to JSON, YAML, Docker & Kubernetes Converter

.env Converter turns a .env file into JSON, YAML, TOML, a docker-compose environment block, a Kubernetes ConfigMap or Secret, GitHub Actions env syntax, docker run -e flags, or shell export lines. It also flattens nested JSON, YAML, or TOML back into .env format. Quotes, multi-line values, ${VAR} expansion, and duplicate keys are handled, secrets can be masked, and you can generate a .env.example file with values removed.

How to use

  1. Paste your .env file, or paste JSON / YAML / TOML to convert in the other direction.
  2. Choose the output format, such as Kubernetes Secret or docker-compose.
  3. Turn on secret masking if you are going to share the output.
  4. Copy the result, or generate a .env.example for your repository.

FAQ

How do I convert a .env file to a Kubernetes Secret?

Paste the .env content and choose Kubernetes Secret. The tool outputs a Secret manifest with base64-encoded values that you can apply with kubectl.

How do I create a .env.example file?

Paste your .env and choose the .env.example output. Keys are kept and values are removed, so the file is safe to commit.

Are my secrets uploaded?

No. The tool runs entirely in your browser. Your input is processed locally and is never uploaded to a server.

Convert .env files to JSON, YAML, TOML, docker-compose, Kubernetes ConfigMap/Secret, GitHub Actions, and shell exports โ€” or flatten nested JSON/YAML/TOML into .env.

.env

Loading editor...

# App
NODE_ENV=production
PORT=3000
APP_URL=https://example.com

# Database
DB__HOST=localhost
DB__PORT=5432
DB__USER=app
DB__PASSWORD="p@ss w0rd#1"
DATABASE_URL=postgres://${DB__USER}:${DB__PASSWORD}@${DB__HOST}:${DB__PORT}/app

# Features
FEATURE_FLAGS=["search","beta"]
DEBUG=false
API_KEY=sk_live_1234567890abcdef
GREETING='Hello $USER'
Output

Loading editor...

{
  "NODE_ENV": "production",
  "PORT": 3000,
  "APP_URL": "https://example.com",
  "DB": {
    "HOST": "localhost",
    "PORT": 5432,
    "USER": "app",
    "PASSWORD": "p@ss w0rd#1"
  },
  "DATABASE_URL": "postgres://app:p@ss w0rd#1@localhost:5432/app",
  "FEATURE_FLAGS": [
    "search",
    "beta"
  ],
  "DEBUG": false,
  "API_KEY": "sk_live_1234567890abcdef",
  "GREETING": "Hello $USER"
}

Variables ยท 12 ยท 2 look secret

NODE_ENV productionline 2
PORT 3000line 3
APP_URL https://example.comline 4
DB__HOST localhostline 7
DB__PORT 5432line 8
DB__USER appline 9
DB__PASSWORD ๐Ÿ”’p@โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข#1line 10
DATABASE_URL postgres://app:p@ss w0rd#1@localhost:5432/appline 11
FEATURE_FLAGS ["search","beta"]line 14
DEBUG falseline 15
API_KEY ๐Ÿ”’skโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขefline 16
GREETING Hello $USERline 17