About this tool
Lint a .env file before deployment — syntax, quoting, duplicates, multiline values and parser-compatibility pitfalls.
This tool lints a .env file line by line, reporting syntax errors, unclosed quotes, duplicate keys, invalid variable names and multiline values before they break a deployment. Because the .env format has no single standard, it validates against both the dotenv (npm) parsing rules and the stricter POSIX name rule [A-Za-z_][A-Za-z0-9_]* used by shells and docker --env-file, flagging every construct the parsers treat differently.
Open Env File Validator on AltFTool — it loads instantly in your browser.
Upload or drag in the file you want to work with.
Adjust the settings and preview the result.
Download the finished file to your device.
Hard failures (unclosed quotes, malformed lines) are separated from portability warnings, each with a line number.
Flags exactly where dotenv, POSIX shells and docker --env-file disagree: quoting, multiline values, export prefixes, inline comments.
Duplicate keys are reported with both line numbers and dotenv's last-assignment-wins rule spelled out.
The hard failures are lines that are not KEY=VALUE assignments, empty keys, unclosed quotes, and stray text after a closing quote. An unclosed quote is the worst one: dotenv-style parsers absorb every following line into that value, so variables defined below it disappear.
The portable POSIX rule (IEEE Std 1003.1, section 8.1) is a letter or underscore followed by letters, digits or underscores — [A-Za-z_][A-Za-z0-9_]*. The npm dotenv parser is looser and also accepts dots and hyphens, but shells and docker --env-file will reject such names, so the tool flags them as portability warnings.
Because docker --env-file does not implement dotenv semantics: it keeps quotes as literal characters, keeps # inside values instead of treating it as a comment, reads only single-line values, and treats an 'export ' prefix as part of the key. The validator flags each of these constructs so you can rewrite them portably.
With dotenv's parser the last assignment wins and the earlier value is dead configuration. The validator reports the duplicate with both line numbers; note that dotenv's config() call additionally never overrides variables already present in process.env unless the override option is set.