.env / dotenv Parser & Validator
Paste the contents of a .env file to parse it into keys and values, catch syntax problems and duplicate keys, and export as JSON or shell exports.
Last updated
.env content
Summary
Issues
Parsed variables
No key/value pairs found.
Export
How to check a .env file
- Paste your .env file, or click Load sample.
- Click Parse & validate to see each key and value and any problems.
- Export as JSON or shell exports, and click Copy.
About this tool
A .env file holds KEY=value pairs, one per line, that get loaded into a process's environment — used by nearly every framework and dotenv-style library (Node's dotenv, Python's python-dotenv, Rails, Docker Compose, and more). The format looks trivial but has enough small rules that hand-parsing it goes wrong in predictable ways: this tool implements the common dotenv conventions and tells you exactly where a line breaks them.
It handles comments (#, only when not inside quotes), blank lines, an optional leading export , single- and double-quoted values (with backslash escapes and \n expansion inside double quotes only, matching Node's dotenv), and unquoted values with surrounding whitespace trimmed. It flags real problems: missing =, empty or invalid key names (dotenv keys must start with a letter or underscore and contain only letters, digits, and underscores), unterminated quotes, and duplicate keys — noting that most parsers keep the last occurrence when a key repeats, which is easy to miss when skimming a long file.
Values whose key name suggests a credential (containing SECRET, KEY, TOKEN, PASSWORD, PWD, or similar) are masked in the table by default — check "Reveal values that look like secrets" to show them. This is a naming heuristic only, not a guarantee; it exists so you can screenshot or share a parsed table without leaking a live credential by accident.
Once parsed, export the result as JSON (handy for feeding into other tooling) or as POSIX shell export statements (handy for sourcing directly). Everything runs locally in your browser; nothing you paste is ever uploaded anywhere.
Questions about .env files
What is a .env file?
A text file of KEY=value lines that apps load as environment variables, for settings and secrets kept out of the code.
What problems does it find?
Lines missing an =, invalid key names, duplicate keys, and unclosed quotes, each with its line number.
Are my secrets safe here?
The file is parsed in your browser and never sent anywhere, and values that look like secrets are masked unless you choose to reveal them.
Do comments and quotes work?
Yes: # comments (outside quotes), blank lines, export prefixes, and single- or double-quoted values, with \n line breaks inside double quotes, as Node’s dotenv does.