Env File Parser
Parse .env files online. Visualize key-value pairs in a table, detect format errors (missing =, duplicate keys, empty values), and export to JSON. Free, runs in your browser.
- Runs in your browser
- Your data never leaves your browser
- Free · No Sign-Up
Scan with WeChat to share this tool
Examples, details and FAQ Worked examples, how it compares with other tools, and answers to common questions.
Example
This input uses made-up values and covers the cases the parser treats specially:
# Database config
DB_HOST=localhost
DB_PORT=5432 # default port
DB_PASSWORD="s3cr3t#1"
API_KEY=
APP_ENV=development
APP_ENV=production
export NODE_ENV=production
COLOR=#fff
PRIVATE_KEY="-----BEGIN KEY-----
abc
-----END KEY-----"
GREETING="Hello\nWorld"
SINGLE='Hello\nWorld'
my-key=1
BROKEN LINE
The table and notes it produces:
| Line | Key | Value | Notes |
|---|---|---|---|
| 3 | DB_PORT | 5432 | — (the comment is cut off) |
| 4 | DB_PASSWORD | s3cr3t#1 | — (the # is inside quotes) |
| 5 | API_KEY | (empty) | Empty value |
| 7 | APP_ENV | production | Duplicate key |
| 8 | NODE_ENV | production | — (export is dropped) |
| 9 | COLOR | (empty) | Text after # is a comment; quote the value to keep it, Empty value |
| 10 | PRIVATE_KEY | three lines | Multiline value (lines 10-12) |
| 13 | GREETING | two lines | — (double quotes expand \n) |
| 14 | SINGLE | Hello\nWorld | — (single quotes keep it literally) |
| 15 | my-key | 1 | Non-standard key name |
| 16 | BROKEN LINE | Missing = sign | |
The status line reads “7 valid, 5 warnings, 1 error.” (rows 2, 6 and the others without notes count as valid). Export JSON then
downloads env.json with 11 keys, the same object that dotenv 16.6.1’s dotenv.parse() returns for this text:
APP_ENV is production, COLOR is an empty string, and the broken line is left out. The tool’s test suite
compares its export with dotenv.parse() on this example and on a set of edge cases.
Colons, Spaces and Other Keys
dotenv also reads KEY: value, as in YAML, but only with a space after the colon. A line that dotenv skips is an error in
the table and is left out of Export JSON; a key that dotenv accepts but that is unusual gets a warning and stays in the
export:
DB_HOST: db.internal
export REDIS_URL: redis://cache:6379/0
MY KEY=1
my.key=2
PORT:8080
{
"DB_HOST": "db.internal",
"REDIS_URL": "redis://cache:6379/0",
"my.key": "2"
}
The status line reads “2 valid, 1 warning, 2 errors.” Line 3 (MY KEY=1) shows Non-standard key name as an error
because dotenv’s key pattern [\w.-]+ has no space. Line 5 shows Use KEY=value, or KEY: value with a space after the colon and
none before it. Node.js has its own parser (—env-file, util.parseEnv()), and Node.js 22.23.3 reads this text
differently: it keeps MY KEY and my.key and ignores all three colon lines.
A key named proto is the one place where the export differs from dotenv.parse(), which drops that key:
__proto__=keep
A=1
{
"__proto__": "keep",
"A": "1"
}
Limits
- No variable expansion.
${HOME}/datastays as written. dotenv-expand, Docker Compose and some frameworks expand such references, so the value your app sees can differ. - dotenv rules only. Other loaders differ: Node.js
—env-file(see above), Docker Compose’senv_file, Python’s python-dotenv and shellsourcetreat quotes, colons,exportand#in their own ways. Check the loader you actually use when a value contains quotes or#, or when a line uses a colon. - Values are shown in clear text. The table does not mask secrets, so mind screen sharing; nothing is stored or sent. To share a file safely, replace the values with the secret redactor first.
- JSON only. There is no export to YAML, shell
exportlines or a Kubernetes Secret; the downloaded file is always namedenv.json.
Common .env Pitfalls Detected
- Missing = sign — the line has neither
=nor a colon, so it cannot be parsed as a key-value pair. - Colon without a space —
PORT:8080andPORT : 8080are skipped by dotenv; writePORT=8080orPORT: 8080. - Empty value — the key exists but the value is blank; may cause runtime errors depending on your app.
- Duplicate key — the same key appears more than once; dotenv uses the last value, other loaders may not.
- Non-standard key name — keys should start with a letter or underscore and contain only letters, digits, and underscores. Keys with
.or-or a leading digit still load in dotenv (warning); keys with a space or other characters do not (error). - # in an unquoted value — dotenv starts a comment there, so
COLOR=#fffis empty andURL=https://example.com/#toploses#top. Put the value in quotes. Rules: dotenv parsing rules.
FAQ
What .env syntax is supported?
The rules of dotenv 16.6.1 (the dotenv package for Node.js): one KEY=VALUE pair per line, or KEY: value with a space after the colon, with an optional export prefix. A key may use letters, digits, _, . and -. Lines starting with # are comments. A # after an unquoted value starts an inline comment, so PORT=5432 # default gives 5432, and a # inside quotes is kept. Quoted values can span several lines.
How are quoted values handled?
Single quotes, double quotes, and backticks around a value are removed, and whitespace inside them is kept. Only double-quoted values turn \n into a line break. A quote that is not closed stays in the value, and the Notes column flags it.
What counts as an error?
A line is an error when dotenv would skip it, and it is not exported: no = or colon (Missing = sign), an empty key, a key with a space or another character dotenv does not allow, such as MY KEY=1 (Non-standard key name), or a colon without a space after it or with a space before it, such as PORT:8080. Warnings are shown for empty values, duplicate keys, and keys that dotenv accepts but that do not match [A-Za-z_][A-Za-z0-9_]*, such as my.key or 9KEY; these keys are still exported.
Is my .env file sent to a server?
No. All parsing happens in your browser using JavaScript, and the text is not saved between visits. Because .env files hold secrets, this page also does not load Google Analytics or AdSense.
What does Export JSON produce?
A JSON object with every key the table shows without an error, the same object dotenv.parse() returns. Commented lines and errors are excluded. A duplicate key keeps its last value, as in dotenv; every occurrence still appears in the table with a warning. One difference: a key named __proto__ is exported as a normal property, while dotenv.parse() leaves it out. Export JSON works only after Parse, and only when at least one key can be exported.