.env Converter
Convert .env files to JSON, YAML, shell, Docker, Compose or Kubernetes env.
About this tool
Paste a .env (dotenv) file and choose the output: JSON, YAML, bash/zsh export lines, PowerShell $env:, docker run -e flags, a Docker Compose environment block, a Kubernetes env list, or .env again. You can also paste a JSON object to create a .env file. Tick Mask secrets to hide sensitive values before sharing.
How dotenv files work
A .env file stores environment variables as KEY=value lines, read at start-up by libraries such as dotenv (Node), python-dotenv, Ruby's dotenv and Docker Compose. The parser follows their common rules: an optional export prefix, # comments and inline comments after unquoted values, single-quoted values taken literally, double-quoted values with \n, \t and \" escapes, and multi-line double-quoted values such as private keys. Each output format quotes values safely for its target. Shell exports use single quotes so $ and spaces aren't expanded, YAML quotes values that would otherwise be read as numbers or booleans (PORT: "3000"), and Kubernetes values are always strings. Honest limits: variable expansion such as ${OTHER} isn't resolved, and dialects differ slightly between libraries. Environment files often contain secrets. This tool runs entirely in your browser and sends nothing, but never commit real .env files to Git, and mask values before sharing output. INI to JSON, YAML to JSON and docker run to Compose are related.
Frequently asked questions
How do I convert .env to JSON?
Paste the file here and choose JSON. Each KEY=value becomes a property.
How do I use a .env file with docker run?
Choose docker run -e to get a flag per variable, or use docker run --env-file .env.
Is it safe to paste secrets?
It runs only in your browser and sends nothing, but tick Mask secrets before sharing any output.
Is my data uploaded?
No. Everything runs in your browser and nothing is stored or sent.