There is no .env specification, so this one says whose rules it uses
That is the honest starting point rather than a research gap. The nearest thing to a reference is the behaviour of motdotla/dotenv, and every other loader diverges from it somewhere: Docker Compose does not expand \n inside double quotes, docker run --env-file keeps the quotes as part of the value, and a POSIX shell source will happily execute a $(…) in your file.
So this tool names one grammar, implements exactly that, and prints a table of where the others differ — in the report itself, not only on this page. Every row it diverges on produces a finding, so you are told at the point it matters rather than having to read a table.
Values never appear in the report
Findings name the key and the line. Where a value's shape matters it is described — <62 bytes, no whitespace> — and never quoted. There is no toggle that turns this off, because a toggle is a way to make a mistake with someone's production credentials.
That is what makes the Validate report safe to paste into an issue or a chat window. JSON mode does contain the values — that is what conversion means — so treat that output the way you would treat the file.
Secret detection here is heuristic and incomplete: it flags keys whose names look like credentials, and values shaped like a PEM block, an AWS access key or a JWT. The absence of a finding is not evidence that a file holds no secrets, and the report says so on every run.
$(…) is refused and is never evaluated
A .env file is frequently pasted from somewhere you did not write. A tool that evaluated a command substitution — even to "preview" the result — would be a remote code execution feature. This one refuses it loudly, excludes that assignment, and tells you that a shell sourcing the same file would run it.
${VAR} is the opposite case and is preserved literally, because a .env value is data: Docker Compose expands it from the environment, docker run --env-file does not, a shell does, and dotenv's base parser does not. You get an INFO saying which, rather than one runtime's answer baked into your JSON.
The # that eats your password
For an unquoted value, a space followed by # starts a comment and the value ends before it. A # that is not preceded by whitespace is part of the value — so PASSWORD=abc#123 really is abc#123, and PASSWORD=abc #123 really is abc.
Loaders disagree here, and this is the rule that silently truncates a password under the other ones. Any # in an unquoted value gets a warning stating how it was parsed — without showing the value — and pointing out that quoting removes the ambiguity entirely.
Trailing whitespace gets the same treatment: it is stripped from unquoted values, and the strip is reported when it actually removed something, because a trailing space inside a secret is a real and maddening bug.
Quotes, escapes and multi-line values
- Single quotes are literal: no escape processing, no expansion, and whitespace inside them is preserved.
- Double quotes process exactly five escapes —
\n,\r,\t,\\and\". Anything else, like\q, is preserved literally with a warning rather than silently dropped. - Backticks are treated literally, like single quotes. dotenv supports them; most other loaders do not, so this is the least portable form and gets a note saying so.
- All three forms may span lines. Docker Compose and
docker run --env-filedo not support that, which is one of the table rows.
An unterminated quote is an error reporting the position of the opening quote, and that assignment is excluded. Guessing where the value ended is how a parser turns a config bug into a wrong value.
Frequently asked questions
Does anything I paste get uploaded?
No. It is parsed in your browser, never written to localStorage, sessionStorage or the address bar, and this tool does not send it over the network. Chaining the JSON into another Codoryn tool keeps it in the same browser tab — that sounds like an upload and is not one.
Why is my duplicate key still in the JSON?
Because every loader surveyed takes the last assignment, and so does this one. What is different is that every occurrence is reported, with both line numbers — a defect that is silently resolved is a defect that ships.
Why was my line excluded?
An assignment with an error-severity finding is left out of the JSON and counted in the report. It is never emitted with a null, which would invent a value it does not have.
Is export KEY=v supported?
Yes — the prefix is removed, so the key is KEY, and an INFO records that it was there. dotenv and Docker Compose v2 both strip it too, and a shell treats it natively. The one that does not is docker run --env-file: it reads the key as export KEY and refuses the line, because that key contains whitespace.