Developer Tools
Env Example Generator
Turn a real .env into a safe .env.example to commit. Replaces secrets with placeholders, keeps comments and config, and runs in your browser. No upload.
Secrets are replaced before anything is shown. Your real values stay in your browser and are never uploaded, logged, or stored.
Placeholder options
Listed keys keep their real value. Keys that look like secrets are always redacted, even if listed here.
Paste your .env above to generate a committable example file.
What gets redacted, and what gets kept
Always redacted
- Keys that read like a credential: SECRET, TOKEN, PASSWORD, API_KEY, PRIVATE, JWT, DSN, and similar names
- Every value when smart or token mode is set, unless a key is listed as safe
- Stripe, OAuth, signing, and session keys get a clearly fake stand-in
Kept when you allow it
- Config defaults like NODE_ENV, PORT, LOG_LEVEL, and TZ
- Feature flags such as ENABLE_SIGNUP and DEBUG
- Any key you add to the keep-real list, except names that look like secrets
Review the output before committing it. Redaction is based on common naming patterns, so a secret stored under an unusual key name may need to be cleared by hand. The keep-real list is the safe way to carry over values you are sure are not sensitive.
How the example is built
- Each line is parsed the way a dotenv loader reads it: KEY=value with an optional export prefix, quoted or unquoted values, comments, and blank lines. Comments and blank lines are preserved so the example reads like documentation.
- Smart placeholders look at the key name and the shape of the real value, so a DATABASE_URL gets a sample connection string, a PORT keeps a number, and a credential gets an obviously fake stand-in.
- Empty mode produces KEY= lines for a strict template, while token mode fills every redacted value with the same marker so a missing entry is easy to spot.
- Everything runs as local string operations in your browser. The real secrets you paste never leave this page.
How to use
- Paste your real .env file into the input box, or click Load sample to start with an example that contains typical secrets.
- Choose how redacted values are replaced: a smart placeholder inferred from the key, an empty value for a strict template, or a fixed token.
- Turn on Keep safe config values to carry over non-secret settings like NODE_ENV and PORT, and add any keys you are sure are safe to the keep-real list.
- Optionally add type and required hints, keep the export prefix, or uppercase keys to tidy the template.
- Read the .env.example on the right and check the redacted and kept counts to confirm nothing sensitive remains.
- Click Copy or Download .env.example, then commit the file to your repository. Everything stays in your browser.
About this tool
Env Example Generator turns a real, secret-filled .env file into a safe .env.example template you can commit to version control. The twelve-factor convention is to keep secrets out of the repository and check in an example file instead, so a new teammate can copy it to .env and fill in their own values. Producing that example by hand is tedious and risky: it is easy to leave a live API key or database password in the file you push. This tool does the redaction for you. Paste your real .env and read back a version where every value has been replaced with a placeholder, while the structure of the file stays intact. It is a distinct job from the other dotenv tools here: the .env file formatter tidies a single file in place, the .env to JSON converter changes the format, and the dotenv diff checker compares two files, while this one strips the values and hands you a committable template. The parser recognizes the practical subset of dotenv syntax that dotenv-node, python-dotenv, pydantic-settings, viper, docker compose, and GitHub Actions all accept: KEY=value lines with an optional export prefix, double-quoted values with escape sequences, single-quoted literal values, unquoted values, blank lines, full-line comments, and end-of-line comments after unquoted values. A hash that follows whitespace begins a comment while a hash glued to the value is kept, matching how real loaders behave. Comments and blank lines are preserved, so the example reads like documentation rather than a bare list of keys. You choose how redacted values are replaced. Empty mode produces strict KEY= lines for a minimal template. Token mode fills every redacted value with the same marker, such as your_value_here, so a forgotten entry is easy to spot. Smart mode looks at the key name and the shape of the real value to build a descriptive placeholder: a DATABASE_URL gets a sample postgres connection string, a key with URL in the name gets a sample URL, a PORT keeps a number, a boolean flag keeps true or false, an email key gets you@example.com, and a credential key such as a Stripe, JWT, OAuth, or session secret gets an obviously fake stand-in. Keys whose names read like a credential, including SECRET, TOKEN, PASSWORD, API_KEY, PRIVATE, JWT, and DSN, are always redacted and can never be carried over by accident. Configuration values that are not sensitive, such as NODE_ENV, PORT, LOG_LEVEL, and feature flags, can optionally be kept as useful defaults, and you can add any specific key to a keep-real list to preserve its value, except for names that look like secrets. An optional setting inserts a short type and required note above each variable so a teammate knows what to enter, and you can normalize the export prefix and uppercase keys to the conventional SCREAMING_SNAKE_CASE. A live count shows how many variables were redacted versus kept. Everything runs as local string operations in your browser; the real secrets you paste are never uploaded, logged, or stored. Review the output before committing, since redaction is based on common naming patterns and a secret stored under an unusual key name may need to be cleared by hand.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Env File Formatter
Sort, align, dedupe, and tidy a single .env file with quote-aware formatting.
Open tool
ConverterEnv to JSON Converter
Two-way dotenv and JSON converter with multi-line value, secret masking, and nested key support.
Open tool
DeveloperDotenv Diff Checker
Side-by-side .env diff with missing keys, value changes, and secret masking.
Open tool
DeveloperGitignore Generator
Build a .gitignore from curated language, framework, editor, and OS templates.
Open tool
DeveloperJSON Formatter
Format, minify, and validate JSON in your browser.
Open tool