.env Sanitizer (.env to .env.example)
Turns a real .env file into a safe .env.example: secret-looking keys or values are replaced by placeholders, while comments, blank lines and order are preserved.
Use the tool
Why this tool exists
Every project wants a .env.example so new developers know which variables to set, and every project has had the moment where a real secret nearly went into it. Copying the file and blanking values by hand invites mistakes. This tool does the pass for you. It replaces values of keys that look sensitive (PASSWORD, TOKEN, KEY, SECRET, DSN) and values that look like secrets even under a harmless name, such as JWTs, AWS keys, long hex or base64 strings and URLs with embedded passwords. Other settings can be kept or blanked. The detection is heuristic, so read the result before you commit it. Your .env is processed locally in the browser and is not uploaded.
How to use it
- Paste your .env file into the input box.
- Choose whether to keep or blank the values of non-secret settings, and pick the placeholder style.
- Read the output carefully, then save it as .env.example.
Frequently asked questions
How does it decide what is secret?
By key name (for example PASSWORD, TOKEN, KEY, SECRET, DSN) and by value shape: JWTs, AWS and API key formats, long hex or base64 strings, and URLs with passwords. It can miss unusual secrets.
What is preserved?
Comments, blank lines, the order of variables and an optional export prefix are all preserved, so the example file reads like your original. Only the values are replaced or blanked.
Is it safe to paste a real .env?
The processing is local and nothing is uploaded. Even so, treat live secrets with care, and always read the result before committing.
What placeholder styles are there?
The key name in angle brackets, the word changeme, or empty. Choose the one that matches your team's convention.