.env Validator
Parse and validate dotenv content: syntax, duplicate keys and empty values.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Valid: 3 variable(s), 0 warning(s).
How it works
- Read the file line by line, ignoring blank lines and `#` comments.
- Split each remaining line at the first `=` into a key and a value, allowing an optional `export ` prefix.
- Checked the key against the POSIX variable-name pattern, tracked duplicates and checked for empty or unclosed values.
- Only the key, value length and quoting state are reported; secret values are never echoed back.
- Dotenv expansion (`${VAR}`), multi-line values and per-language extensions are not resolved: this is a syntax check.
Methodology
- Ignore blank lines and comments.
- Split each line at the first `=`; validate the key and detect duplicate keys.
- Detect empty values and unclosed quotes.
- Report errors and warnings with line numbers and never echo secret values.
Usage
- Paste the contents of a .env file.
- Read the per-line errors and warnings.
- Fix duplicates, empty values and unclosed quotes before deploying.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
Valid file
{
"content": "NODE_ENV=production\nPORT=3000\n# comment\nAPI_KEY=\"abc\""
}Duplicate key
{
"content": "PORT=3000\nPORT=8080"
}Unclosed quote
{
"content": "API_KEY=\"unterminated"
}Limitations
Syntax versus schema
A `.env` file is a simple `KEY=VALUE` format. This tool checks that each line parses, that keys are valid names, that no key is defined twice and that quotes are balanced. It cannot tell you whether `DATABASE_URL` is reachable or whether a required key is missing.
Because .env files usually hold secrets, the report deliberately shows only the key names, value lengths and quoting state: never the values.
Frequently asked questions
- Are my secrets uploaded anywhere?
- No. The check runs entirely in your browser; no value or file leaves the page and nothing is stored.
- Why is an empty value only a warning?
- An empty value is legal dotenv, but it is often an accident; it is reported as a warning so you can decide.
Sources
- The Open Group Base Specifications: Environment Variables — The Open Group
- dotenv: File format — dotenv
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.