Zero Signup ToolsFree browser tools

Converter Tools

Env to Shell Export Converter

Convert a .env file into shell export statements, docker run flags, docker compose, Kubernetes, GitHub Actions, and tfvars. Runs in your browser. No signup.

Env to shell export converter

Parsing runs in your browser. Your .env file and any secrets in it are never uploaded, logged, or stored.

Output format

Output

Shell export (bash/zsh)

8 variables

export NODE_ENV=production
export PORT=3000
export APP_NAME='My Service'
export DB_PASSWORD='p@ss w0rd#1!'
export DATABASE_URL=postgres://user:secret@localhost:5432/app
export FEATURE_FLAGS=beta,checkout,new-ui
export WELCOME_MESSAGE='Hello,
welcome aboard'
export EMPTY_VALUE=''

What this converts

  • Reads a standard .env file: KEY=value, quoted values, an optional export prefix, and # comments.
  • Double-quoted values decode \n, \t, and \"; single-quoted values are kept literal.
  • Each output format re-quotes values so spaces, quotes, $, and # stay safe in that target.
  • Duplicate keys keep the last value, the same way dotenv loaders behave.

Format notes

  • Shell export can be pasted into a terminal or piped into source.
  • docker run and cmd keep values on one line, so line breaks inside a value are collapsed.
  • The YAML formats (compose, Kubernetes, GitHub Actions) quote any value that could be read as a number, boolean, or null.
  • Replace the placeholder IMAGE with your container image in the docker and Kubernetes output.

How to use

  1. Paste your .env file into the input box, or click Load sample to see the formats with an example file that includes quotes, comments, and special characters.
  2. Pick an output format: shell export for bash or zsh, fish, PowerShell, Windows cmd, plain .env, docker run, docker compose, Kubernetes, GitHub Actions, or Terraform tfvars.
  3. Optionally turn on Sort keys alphabetically; leave it off to keep the original order from your file.
  4. Read the generated output. Values are re-quoted for the chosen target, and warnings flag duplicate keys, missing equals signs, or values that had to be put on one line.
  5. Click Copy output to grab the result. Parsing happens in your browser, so your .env file and its secrets never leave the page.

About this tool

Env to Shell Export Converter parses a dotenv-style .env file once and re-emits it in the formats you actually paste into a terminal, a container, an orchestrator, or a CI pipeline. The .env format is the common denominator for configuration, but almost every destination wants it written differently: a shell wants export KEY=value (or set KEY=value on cmd, or $env:KEY in PowerShell, or set -x in fish), docker run wants repeated -e flags, docker compose wants a YAML environment map, Kubernetes wants an env list of name and value objects, GitHub Actions wants an env block, and Terraform wants KEY = "value" in a .tfvars file. Copying values by hand between these forms is tedious and easy to get wrong, because each target quotes and escapes differently. This tool does the parsing and the re-quoting for you. The parser implements the practical subset that real dotenv loaders agree on: KEY=value with optional double or single quotes, an optional export prefix on input lines, full-line and trailing hash comments, blank lines, empty values kept as an empty string, and duplicate keys where the last value wins. Inside double-quoted values it decodes the usual escapes (\n, \r, \t, \\, \", and \$) and supports values that span multiple lines, while single-quoted values are treated literally with no escape processing. From that single parsed model it generates each output format and re-quotes every value so spaces, quotation marks, dollar signs, hashes, and line breaks stay safe in that specific target. The YAML formats quote any value that could otherwise be misread as a number, boolean, or null, and the single-line formats (docker run and cmd) flag when a multi-line value had to be collapsed. You can keep the original key order or sort keys alphabetically, and copy the result with one click. Everything runs locally in your browser, so the .env file and any secrets in it are never uploaded, logged, or stored.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsConverter Tools