EnvSiftView EnvSift on GitHub
Open tool navigation
All tools

.env.example Generator

Turn a real ENV file into a shareable template. Assignment values are removed locally before you copy or download anything.

0 variables found
Comments and blank lines are preserved unless sorted output is selected.
Review comments for manually written secrets before committing.

Practical guide

How to create a safe .env.example

Generate a shareable inventory of required environment variables from a working .env file. Assignment values are removed locally, while comments can be preserved for setup guidance.

  1. 1Paste or load the source .env file.
  2. 2Preserve its comments and order, or sort and deduplicate the keys.
  3. 3Review comments for manually written secrets before committing the generated template.

What this tool handles

  • Removal of every parsed assignment value
  • Optional comment and blank-line preservation
  • Sorted, deduplicated output when preferred
  • Invalid and duplicate lines marked or omitted instead of copied as secrets

Example

Source
DATABASE_URL=postgres://user:pass@localhost/app
PORT=3000

Template
DATABASE_URL=
PORT=

Frequently asked questions

Is the generated .env.example automatically safe to commit?

Assignment values are removed, but comments are human-written and may contain sensitive text. Always review the output before committing it.

Should optional variables be included?

Usually yes. Document optional variables with comments and safe example guidance so teammates know they exist without receiving real credentials.

What happens to duplicate keys?

Preserved-order output marks later duplicates as omitted. Sorted output emits each valid key once.