What this tool does
A .env file becomes a flat JSON object.
# service
export PORT=8080
NAME="Ada Lovelace"
EMPTY=
{
"PORT": "8080",
"NAME": "Ada Lovelace",
"EMPTY": ""
}
Comment lines and blank lines are skipped, a leading export is removed, and the quotes around a value are removed with it. Inside double quotes, \n and \t become a newline and a tab; inside single quotes, everything stays literal, as in a shell.
A variable set twice is refused
PORT=8080
PORT=3000
Duplicate variable "PORT" on line 2: it already has a different value
A shell keeps the last assignment and says nothing, so the first value simply vanished. In a .env that has been merged, edited and copied between environments, that silence is expensive: you read the file, you see PORT=8080 at the top, and the process runs on 3000. The converter now stops and names the variable and the line. Two identical assignments are not the admission of anything, so they still pass. That was a real defect, found while writing this page and fixed.
Everything is a string
ID=007
ACTIVE=true
COUNT=3
{
"ID": "007",
"ACTIVE": "true",
"COUNT": "3"
}
An environment variable is text: that is what the operating system stores and what process.env gives back. Typing COUNT as a number here would be a guess, and typing ID as one would lose its zeros. The conversion keeps the text, and the typing stays where the meaning is known — in your code.
What the format does not carry
- Expansion.
PATH=$HOME/binstays$HOME/bin. What$HOMEholds depends on a machine this page cannot see. - Nesting.
.envis a flat list of names and values; there are no sections and no structure to find. - A comment after a quoted value.
A="a #b"keeps its hash, because it is inside the quotes. After a bare value,#starts a comment and is cut. - Any name you like. A name must be letters, digits,
_and., and not start with a digit — the rule a shell itself applies. Anything else is refused by name rather than written into JSON that no.envcould hold again.
Private by design
Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.