How This env Parser Works
Paste .env contents and this env parser online tool, also usable as a way to parse dotenv file online content directly, reads standard KEY=value syntax, including quoted values, inline # comments, and \${VAR:-default} interpolation, then breaks it into structured entries. Five modes are available: Parse shows every entry with its key, value, comment, and default-value flag, Validate runs a set of checks and reports warnings, acting as an env variable checker and env file syntax checker in one, and the three converters, to-export (an env to export converter), to-json, and to-docker-env (env file to docker run flags), reshape the same parsed entries into shell export statements, a JSON object, or docker run -e flag lines. An optional key prefix filters entries down to a specific group, like DB_ or AWS_, before conversion.
What the Validator Checks
The Validate mode is a lightweight env file validator, not a real secrets scanner, it's worth knowing exactly what it checks. It flags any entry with an empty value, any key shorter than two characters, and any key name matching password, secret, key, or token (case-insensitively) that doesn't already contain a \${ reference, on the theory that a literal secret sitting in plain text is riskier than one pulled from another variable or a secrets manager at runtime. It also reports the same line-level syntax errors as Parse, such as a line with no = sign or a key that doesn't match the standard [A-Z_][A-Z0-9_]* pattern.
Converting .env to JSON, Export, or Docker Flags
Each conversion mode reshapes the same parsed key-value pairs for a different destination. This env to json converter produces a plain, flat JSON object, useful for feeding config into a JS or Node.js script. The export mode produces shell export statements ready to source into a terminal session or CI job. The docker mode produces docker run -e flag lines, one per variable, backslash-continued for readability, not a --env-file, that distinction matters if you're specifically looking for --env-file formatted output, since this generates command-line flags instead.
| Mode | Sample output | Typical use |
|---|---|---|
| to-json | { "PORT": "3000" } | Feeding config into a JS/Node.js script |
| to-export | export PORT="3000" | Sourcing into a shell session or CI job |
| to-docker-env | -e PORT="3000" | Pasting into a docker run command |
Common Uses
Running a quick validate env file online check before committing a .env.example, converting a local .env into shell exports for a CI script that expects exported variables rather than a dotenv loader, generating docker run -e flags from a project's existing .env so a container run matches local config, and using the prefix filter to review just one integration's variables (like every STRIPE_ or AWS_ key) out of a large file are the most common uses. Spotting an accidentally-empty required variable, or a key named DB_PASSWORD that's holding a literal value instead of a reference, are common things the validator catches.
What This Tool Doesn't Do
This is a one-directional dotenv to json and export/docker converter, it doesn't convert JSON or any other format back into .env syntax. The validator is a naming and emptiness heuristic, not a real secrets scanner, it doesn't check values against any leaked-credential database or verify that a \${...} reference actually resolves to something safe. The docker mode produces docker run -e flags specifically, not --env-file file content, and multi-line quoted values aren't supported, each line is parsed independently.