.env file validator
Find .env problems before starting Docker or your app. Each issue shows its line and level: error, warning or note.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter .env text.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
An error means the line cannot be read: no =, a name that does not match [A-Za-z_][A-Za-z0-9_]*, or an unclosed quote. A warning means some tools will read it differently: space around =, an unquoted value with spaces, a repeated variable or a name with . or -. Notes cover empty values, export and multi-line values.
Example
Result: Result: Errors: 0, warnings: 3, notes: 0; Variables: 5; Errors: 0.
Limits and caveats
- .env rules are not standardised; the check follows what Docker Compose, shells and dotenv all accept.
- It does not check the values themselves, such as URLs or ports.
Questions about this tool
Why is a space around = a warning?
The dotenv library accepts it, but docker run --env-file and shells do not, so removing it is safer.
What is wrong with Hello World unquoted?
If the file is loaded in a shell with source, the value splits at the space. Put it in quotes.
Which value wins for a repeated variable?
The last one in most tools, but some take the first, which is why a repeat is a warning.
