Short answer: paste the file, copy the JSON. Keys keep their order, values stay strings, and a redefined key is reported with both line numbers so the lost value is not a mystery.
The three ways a .env file surprises people
- A trailing comment that is not a comment.
KEY=value#tagkeeps the#tag, because dotenv only treats#as a comment when whitespace precedes it. The page follows that rule rather than tidying it away. - A quoted value that is never closed. Every loader behaves differently; this one refuses, because the alternative is swallowing the rest of the file into one string.
- The same key twice. The later value wins, silently, in production. Here it is a warning on the result.
What it does not do
It does not expand $VARIABLES from the environment, because the environment is not available in a browser and guessing would produce values that never exist at runtime. It also does not validate that a URL is a URL — that check belongs where the value is used.
For the same data as YAML, use the YAML converter; to spot the one key that differs between two environments, the text diff is faster than reading both files.