.env File Parser

Parse .env files into a searchable key-value table, detect duplicate keys, and mask secrets.

Paste a .env file on the left to see parsed variables

When a .env parser is the right tool

Use this page to inspect a dotenv file in the browser: keys, values, blank-line and comment counts, parse errors, and duplicate key names. Paste into the editor; the table updates as you type. There is no Load Sample — the placeholder shows a short DATABASE_URL / API_KEY / DEBUG sketch.

Use cases

Reviewing a file before you commit or share it

Turn on Mask secrets when you want the on-screen values hidden for names that look sensitive. Remember two limits: DATABASE_URL is not masked (the key has no matching token), and Copy still copies the real values of the filtered rows.

Finding duplicates and typo lines

A repeated key is flagged in the table. A line without =, or with an empty key, is listed as an error. The Filter box matches a case-insensitive substring of the key or the unmasked value.

How parsing works

Each line is classified as blank, a full-line # comment, a KEY=value pair, or an error. Inline # comments are stripped only when they sit outside quotes. Matching wrapping quotes are removed from the value. Empty values render as italic “empty” in the table.

Example — mixed .env lines this inspector will classify
DATABASE_URL=postgres://app:secret@db:5432/app
API_KEY=abcd1234efgh
# a comment
export FOO=bar
DEBUG=true
DEBUG=false

In that sample, API_KEY is masked if you turn the option on, DATABASE_URL is not, export FOO is the key for the export line, and both DEBUG rows stay in the table as duplicates.

What this tool does not do

It does not interpolate $VAR or ${VAR}, parse multiline quoted values, or strip an export prefix. It does not upload your file. For sectioned.ini configs, use INI ↔ JSON.

How to use .env File Parser

  1. Paste a .env file into the editor. The table fills in as you type.
  2. Optionally turn on Mask secrets and type a Filter substring.
  3. Use Copy when you want key=value lines for the visible rows — those copied values are not masked.

Frequently asked questions

How does the .env parser work?

Parsing is live as you type. Blank lines are counted. A line whose trimmed text starts with # is a comment (the text after # is collected). Other lines must contain an = with a non-empty key; otherwise you get an error such as Line N: no "=" found or empty key. Surrounding matching quotes on a value are stripped, but escape sequences like \n are not expanded. There is no Load Sample button.

Does Mask secrets hide every password? What does Copy do?

Masking looks only at the key name, with a case-insensitive pattern for secret, password, passwd, token, key, api, private, or credential(s). API_KEY and API_URL are masked; DATABASE_URL and HOST are not, even if the value looks like a connection string. A masked value of four characters or fewer becomes ****; longer values keep the first two and last two characters. Copy still writes the real, unmasked key=value lines for the currently filtered rows, even when Mask secrets is on.

How are export, comments, and duplicate keys handled?

The word export is not stripped, so export FOO=bar is stored under the key "export FOO". An unquoted trailing # comment on a value line is removed; a # inside quotes is kept. Duplicate keys are all shown and marked dup. The warning “Duplicate keys detected (last value wins at runtime)” describes typical dotenv loaders — this table keeps every occurrence, and Copy includes them all.

Is my .env file uploaded?

No. Parsing runs in your browser. Closing the tab discards what you pasted. Still, treat a real production .env carefully: Copy uses unmasked values, and a screenshot of the unmasked table would leak them.

Related tools and guides

References

  • Many runtimes follow dotenv-style KEY=value files. This page is an inspector, not a loader: it does not interpolate $VAR, expand escaped newlines, or drop the first of two duplicate keys.
  • Secret masking is a name heuristic only. It is not a leak scanner and does not consult a database of secrets.