.env File Validator & Cleaner
Paste a .env file to see exactly how it will be read and what is wrong with it: duplicate keys, lines that are ignored, unclosed quotes, # comments that cut a value short, spaces around = and secrets that should stay out of Git. Compare it with .env.example to find missing keys, and make a clean copy with secret values hidden. Everything runs in your browser.
🔒 Your file is checked in this browser and is never uploaded. Even so, avoid pasting real production secrets into any website: use fake values, or remove the secrets first.
How to use it
- Paste your .env file into the left box (use fake values or remove real secrets first), or press “Load sample”.
- Read the problems list. Filter it by errors, warnings or notes. Each item shows the line number.
- Optionally paste your .env.example on the right to see which keys are missing, empty or extra.
- Use the clean copy to tidy the file, sort the keys or hide secret values before sharing it.
Frequently asked questions
How is the file read?
The same way the popular dotenv library reads it: KEY=value lines, optional export, single, double and backtick quotes, # comments, and double-quoted values that can span lines with \n escapes. The tool uses the same rules, so what you see is what dotenv will load.
What does a line that is ignored mean?
A line that is not empty, not a comment and not in KEY=value form, such as a stray word or a key with no equals sign. dotenv skips it silently, which can hide a typo until the app fails.
Why is a # in my value cut off?
In an unquoted value, a # starts a comment, so everything after it is dropped. Put the value in quotes if the # belongs to it, for example PASSWORD="abc#123".
Is it safe to paste my real .env here?
The file is checked inside your browser and is not uploaded. Even so, treat any real secret pasted into a website as exposed. Use fake values, or delete the secrets before checking the structure.
Should .env be committed to Git?
No. It usually holds passwords and keys. Add it to .gitignore and commit a .env.example with the key names and no values, so other developers know what to set. If a secret was ever committed, treat it as leaked and replace it.
Related tools
These tools run entirely in your browser and are provided free, without warranty. Check important results before using them in production.