Skip to content
snowkitDev

Make a .env.example without leaking secrets

Paste or open a .env file and get a .env.example with every value removed, your comments and grouping kept, and problems like duplicate keys pointed out.

.env to .env.example

Paste or open a .env file. Values are removed as you type.

.env.example


            

Variables

    Options

    Harmless values are short numbers, true or false, environment names such as production, and localhost addresses. Anything whose name suggests a secret is always removed.

    Compare with an existing .env.example

      Saved as env.example. Rename it to .env.example in your project.

      Your .env file is read in this tab only. It's never uploaded and never stored. Turn a real .env file into a safe .env.example you can commit, with the values removed and the comments kept. It is free and runs in your browser.

      How to make a .env.example

      1. Paste your file into the .env box, or press Open a .env file. Try an example loads a sample.
      2. Choose what to Replace values with: Nothing (KEY=), A hint (KEY=your_key) or Empty quotes (KEY="").
      3. Choose what to keep: Keep comment lines, Keep comments after values, Keep blank lines between groups, and Keep harmless values like PORT=3000.
      4. Optionally paste your current file into Existing .env.example to compare.
      5. Press Copy or Download .env.example.

      Why keep a .env.example

      A .env file holds the settings and secrets an app needs, and it should never be committed. A .env.example lists the same keys with the values removed, so anyone setting up the project knows what to fill in. Keeping the comments from your own file explains what each value is for.

      What is kept and what is removed

      Every value is removed by default, including quoted and multi-line values such as private keys. Comment lines, comments after values, export prefixes and the blank lines that group settings are kept exactly as you wrote them; nothing is added. Lines that aren't KEY=value and repeated keys are left out and listed so you can fix the original.

      Tips

      • Add a short comment above each key explaining where to get the value.
      • Group related keys together with blank lines, such as database, email and payments.
      • Make sure the real .env is listed in your .gitignore. The .gitignore generator can write one.
      • Update the example whenever you add a setting, so new teammates are not left guessing.
      • If a secret was ever committed, change it. Removing the line later does not remove it from history.

      Who uses it

      Developers, students sharing a project and freelancers handing a codebase to a client, anyone who wants setup instructions without exposing passwords and keys.

      Questions

      Is it safe to paste real secrets here?

      The page works entirely on your device and has no way to send what you paste anywhere. Even so, treat secrets with care: close the tab when you're done.

      Can I keep some values?

      Turn on Keep harmless values to keep things like PORT=3000, DEBUG=false or NODE_ENV=development. Values whose key mentions a secret, token, password or key, values with a password inside a URL, and long random-looking strings are still removed.

      Why is the download called env.example?

      Browsers don’t save files whose names start with a dot, so the download is named env.example. Rename it to .env.example when you add it to your project, or use Copy and paste into a new file.

      How do I check an old .env.example is up to date?

      Open Compare with an existing .env.example and paste it. Keys in your .env that the example is missing, and keys the example has that your .env doesn't, are listed.

      Where to next

      Carry on with what you just made, still on your device.

      More from Snowkit