.env · workflow

ENV Splitter

Paste one combined .env file and split it by prefix (DEV_, PROD_) or by comment markers. Output multiple files ready to commit.

Be the first to rate
.env.dev
3 keys
DATABASE_URL=postgres://localhost/dev
LOG_LEVEL=debug
SHARED_API_VERSION=v2
.env.prod
3 keys
DATABASE_URL=postgres://prod.example.com/app
LOG_LEVEL=info
SHARED_API_VERSION=v2
.env.test
2 keys
DATABASE_URL=postgres://localhost/test
SHARED_API_VERSION=v2

What it does

  • Split by prefix (DEV_, STAGING_, PROD_) — prefixes are stripped in output
  • Split by comment markers (# === prod ===)
  • Preview every output file before downloading
  • Works with any naming convention
  • 100% client-side

Privacy

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

client-side only

Usage examples

Case 1 · Prefix split
DEV_DB_URL=postgres://localhost/dev
PROD_DB_URL=postgres://prod.example.com/app
PORT=3000
// .env.dev
DB_URL=postgres://localhost/dev
PORT=3000

// .env.prod
DB_URL=postgres://prod.example.com/app
PORT=3000
Case 2 · Marker split
# === dev ===
DB_URL=localhost
# === prod ===
DB_URL=prod.example.com
// .env.dev
DB_URL=localhost

// .env.prod
DB_URL=prod.example.com
Case 3 · Three-env prefix with shared keys
DEV_DB=localhost
STAGING_DB=staging.db
PROD_DB=prod.db
NODE_ENV=production
// .env.dev
DB=localhost
NODE_ENV=production

// .env.staging
DB=staging.db
NODE_ENV=production

// .env.prod
DB=prod.db
NODE_ENV=production

When to use this tool

  • Migrating from a monolithic .env to per-environment files
  • Cleaning up a legacy .env full of DEV_/PROD_ prefixed copies
  • Preparing separate files for Vercel / Netlify / Railway environments
  • Splitting a CI-mode .env.ci into .env.test and .env.build

Common mistakes

  • Using inconsistent prefixes — pick one convention (DEV_* or dev-*) and stick with it
  • Forgetting that prefix-splitting strips the prefix: DEV_DB_URL becomes DB_URL in the output
  • Sharing the combined source .env after splitting — delete it or rename to .env.combined.ignore

ENV Splitter — split one .env into multiple environment files

The env splitter takes a single, combined .env file and produces separate files per environment. Two split strategies are supported: prefix (keys prefixed with DEV_ / PROD_ / etc.) and markers (comment blocks like # === prod ===).

When splitting makes sense

Teams that started small often end up with one .env containing keys for every environment. As soon as you deploy to more than one host, that becomes painful — you have to grep for the right block, and mistakes leak prod credentials into dev. Splitting the file once, then committing .env.example with the structure, fixes the problem for good.

Related tools

Learn more

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.