ENV to JSON converter: what each output is for
JSON suits tools and scripts that read configuration as an object. Every value stays a string unless you turn on number and true/false types, because a .env file has no types of its own.
YAML gives a flat mapping with every value in double quotes, so values such as yes, 08 or 1e3 are not read as a boolean or a number by a YAML parser.
The export tab writes one export line per variable, ready to paste into a shell. Single quotes keep every character literal. A single quote cannot occur inside single quotes in the POSIX shell, so a single quote inside a value is written by closing the quote, adding an escaped single quote and opening it again. Names that a shell cannot use, such as one with a dot, are left out and listed.
Convert env to JSON online without uploading the file
Many online converters send your text to a server. This page converts with JavaScript inside your browser tab and does not send or save what you paste. A .env file usually holds passwords and API keys, so that matters. You can check it yourself: open the Network tab in your browser's developer tools, paste a file and watch that no request is made.
Env file to JSON: how the file is read
Comments, blank lines and an optional export prefix are ignored. A value can be unquoted or wrapped in single quotes, double quotes or backticks, and a quoted value can run over several lines. In an unquoted value an inline comment starts at a space followed by #, which is the Docker Compose rule. The dotenv README says a # starts a comment wherever it appears in an unquoted value, so wrap any value that contains # in quotes.
If a key appears twice, the last one is used and the tool lists the repeated keys. A line that cannot be read is listed with its line number instead of being dropped without a word.
Dotenv to JSON, YAML and back to .env
Paste a JSON object and the same tabs write it as .env lines, YAML or Compose. A .env file is flat, so nested objects and lists are skipped and each skipped key is named, so you can flatten it first. Numbers and true/false become their text, and null becomes an empty value.
The .env tab asks who will read the file, because Next.js with dotenv and Docker Compose treat quotes and dollar signs differently. For Next.js and dotenv we measured the loader that ships with Next.js 15: a dollar sign is expanded inside every kind of quote and a backslash in front of it keeps it literal, and a double quote cannot be escaped inside double quotes, so a value that contains one goes in single quotes or backticks. Docker's documentation says single-quoted values are literal while unquoted and double-quoted values have variables expanded. A value that cannot be written exactly for the chosen reader is flagged. For dotenv it is written as a comment line, so it cannot break the lines below it.
Convert env to YAML for configuration files
The YAML tab writes KEY: "value" for each variable. Keys that some YAML parsers read as a boolean or null, such as yes, no, on, off or null, are quoted as well, so the key stays the text you wrote.
Env file to docker compose: the environment block and the dollar sign
The docker-compose tab writes a services block with an environment section. Docker Compose accepts environment as a mapping or as a list, and the tool offers both. Compose treats a single dollar sign as the start of a variable, and Docker's reference says to write a double dollar sign when you need a literal one. The tab does that by default; switch it off if you want Compose to substitute the variable itself.
Docker's documentation also advises against passing passwords to containers through environment variables and points to Compose secrets instead. Replace the service name app with your own.
Next.js check: public variables that look like secrets
According to the Next.js guide on environment variables, every variable that starts with NEXT_PUBLIC_ is inlined into the JavaScript sent to the browser. The tool flags such a variable when its name contains SECRET, TOKEN, PASSWORD, PASSWD, PRIVATE or CREDENTIAL. The check goes by the name only; it cannot know whether a value is really secret.
Next.js and Docker Compose expand $VARIABLE references when they read a .env file. This converter does not: every value is kept exactly as written, and a note lists the keys whose value contains a dollar sign.
