.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.

Copied

Last updated

.env content

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.