What the converter does line by line
It reads your .env text one line at a time and applies a short rule list. The output updates live as you type, and nothing is sent anywhere.
- A blank line stays blank.
- A line that starts with
#is a comment, kept or dropped depending on the "Keep comments" checkbox. - A line shaped like
KEY=valueis processed. The key must start with a letter or underscore and may contain letters, digits, underscores, dots and hyphens, with an optional leadingexport. - If the value opens a quote that is not closed on the same line, the following lines up to the closing quote belong to that value and are never output.
- Any other line is left out, and a note under the output says how many were dropped, so a stray value can never reach the file.
For a recognised KEY=value line, the value style decides what follows the equals sign.
| Value style | Input | Output |
|---|---|---|
| Blank | API_KEY=sk_live_51H8x | API_KEY= |
| Placeholder | API_KEY=sk_live_51H8x | API_KEY=<your_api_key> |
| Keep example values | PORT=3000 | PORT=3000 (the whole line unchanged) |
Worked example
With the default sample, which has a comment, a database URL, an API key and a debug flag, Blank mode produces:
# Database
DATABASE_URL=
API_KEY=
DEBUG=
Placeholder mode turns the same lines into DATABASE_URL=<your_database_url>, API_KEY=<your_api_key> and DEBUG=<your_debug>, where the placeholder is the lower-cased key name. An export prefix is kept: export DEBUG=true becomes export DEBUG=.
Edge cases it handles
In Blank and Placeholder modes the output is built only from key names, comments and blank lines, so nothing from a value can survive.
- Multi-line values. A quoted private key spread over several lines becomes a single
PRIVATE_KEY=line. The key material and the closing quote are dropped, and an unclosed quote swallows the rest of the input rather than leaking it. - Unusual key names. Keys with dots or hyphens, such as
my-token=abc123, are treated like any other key. In Placeholder mode the dots and hyphens become underscores, so the placeholder is<your_my_token>. - Inline comments. In
PORT=3000 # dev, the comment after the value is kept when "Keep comments" is ticked, givingPORT= # dev. A#with no space before it, as inabc#123, is part of the value. A#inside quotes is never treated as a comment. - Keep example values mode outputs your text unchanged, so use it only when the values are already safe.
If a real secret ever reached a public repository, deleting it from the file is not enough; it stays in the git history, so rotate the credential. The UUID generator and password generator make fresh values for new keys, and JSON formatter covers config that lives in JSON rather than dotenv.