Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

.env File Converter and Validator (JSON, YAML, Kubernetes, Docker)

Convert .env files and see how Compose, dotenv, Docker, systemd and a shell read them.

Free preview, no sign-upIncluded in your pass Pro tool Pro pass: ₹179 for 30 days No upload Works offline Developer

Try before you buy.

  • Free preview: every count, the first lines of the converted file (up to 20), and the first problems, variables and differences between programs (up to 10).
  • Locked until you unlock it: download and copy.
  • Unlock: Pro pass, ₹179 for 30 days, a one-time payment that never renews.

Ways to unlock shows how to get the full result.

See passes (opens in a new tab)

Printing this result is locked in the free preview.

Read in your browser as you type; nothing is sent anywhere.

The values, checks and conversion follow this program.

Compare with .env.example (optional)

Next steps Done. What next?

All developer tools

About the .env File Converter and Validator (JSON, YAML, Kubernetes, Docker)

Paste a .env file to convert it and to see what each program really reads from it. The same file gives different values to different programs, and this page reads it the way each one does:

  • Docker Compose (.env and env_file): quotes, escapes in double quotes, multi-line values, export, comments after #, and ${VAR} expansion.
  • dotenv for Node.js: quotes and backticks removed, \n expanded in double quotes, # ends an unquoted value, no expansion.
  • **docker run --env-file and kubectl create secret --from-env-file**: every character after = kept — quotes, trailing blanks and comments included — and no multi-line values.
  • **systemd EnvironmentFile=**: shell-like quotes and backslashes, comments only at the start of a line, and names other than letters, digits and _ ignored.
  • A shell that sources the file: a value with an unquoted space runs the rest of the line as a command.

Convert to JSON, YAML, a Kubernetes Secret (base64) or ConfigMap, a **Compose environment: block, GitHub Actions** env: or a step that writes $GITHUB_ENV, **shell export lines, a systemd EnvironmentFile, a Docker env-file**, or a .env for Compose or dotenv — and back from JSON, YAML, Kubernetes, Compose and GitHub Actions. Each output is quoted for the program that reads it. The checks find duplicate names, names a program refuses, unquoted spaces, trailing blanks, # that dotenv cuts, and differences between programs, and **compare .env.example** with your .env. Values in the results stay hidden until you tick Show values, the findings and the report name variables without their values, and nothing leaves your browser.

Without a pass the result is a free preview: every count, the first lines of the converted file and the first findings. The whole result, the copies and the downloads unlock with a Pro pass.

How to use it

  1. Paste your .env (or JSON, YAML, a Kubernetes Secret or ConfigMap, a Compose environment: block or GitHub Actions env:), open a file, or press Load example. Read as detects the format; choose it if the guess is wrong.
  2. For a .env file, choose Who reads it — Docker Compose, dotenv, docker run, kubectl, systemd or a shell. The variables, the checks and the conversion follow that program.
  3. Pick Convert to. For Kubernetes, set the name and namespace; for GitHub Actions, secret-looking names can become ${{ secrets.NAME }}. Tick Show values to see the values on screen.
  4. Read the findings and How each program reads it, which lists every variable that two programs read differently. Paste a .env.example under Compare to list the missing and extra names.
  5. With a pass, or once this result is unlocked, copy or download the converted file and the report; the preview shows the first lines and locks the copies and downloads.

Examples

A # in an unquoted value
Input
BRAND_COLOR=#336699
Result
Compose, docker run, systemd and a shell: #336699 — dotenv: an empty value (it takes # as a comment). Quote it: BRAND_COLOR='#336699'
Quotes with docker run --env-file
Input
DB_PASSWORD='s3cr3t'
Result
Compose and dotenv: s3cr3t — docker run --env-file and kubectl: 's3cr3t' (the quotes are part of the value).
A Kubernetes Secret
Input
API_KEY=abc123
Result
apiVersion: v1
kind: Secret
metadata:
  name: app-env
type: Opaque
data:
  API_KEY: YWJjMTIz

Secret values are base64-encoded, not encrypted: anyone who can read the Secret can decode them.

Where the rules come from

Each reader follows its program’s own code and documentation: Compose’s .env syntax and its parser, the expression dotenv uses to read a line, the Docker CLI’s key/value file reader (also used by docker run --label-file), kubectl’s --from-env-file reader and its name rule, the EnvironmentFile= rules of systemd.exec(5), and POSIX shell quoting. The outputs were read back by the real programs — Docker Compose, dotenv and a POSIX shell — to check that every value comes back unchanged.

Kubernetes Secrets are not encrypted

A Secret’s data values are base64, which anyone can decode; Kubernetes recommends encryption at rest and RBAC that limits who can read Secrets. Do not commit a Secret manifest with real values: apply it from a protected location, or use a tool that encrypts it. With stringData the values stay readable in the manifest and Kubernetes encodes them when you apply it.

Limitations

  • Nothing is run: command substitution ($(…) or backticks) in a shell file is reported and shown as written.
  • Variables a program takes from your environment (a name without “=”) are not known here.
  • dotenv is read without dotenv-expand; other .env libraries (Python, Ruby, Go) have their own rules close to these.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

Frequently asked questions

What do I get without a pass?

Without a pass, .env File Converter and Validator (JSON, YAML, Kubernetes, Docker) shows every count, the first lines of the converted file (up to 20), and the first problems, variables and differences between programs (up to 10). Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.

Why does docker run --env-file give my app quotes in its values?

docker run --env-file (and kubectl’s --from-env-file) take every character after = as the value, quotes and trailing blanks included, and do not support multi-line values or export. Write such files without quotes — choose Docker env-file under Convert to — or let Compose read the file with env_file:.

Is my .env file uploaded?

No. It is read and converted in your browser, and the values in the results stay hidden until you tick Show values. The findings and the report you can copy or download name the variables and the problems, never the values.

How do I compare .env.example with .env?

Paste the example under Compare with .env.example: the page lists names the example has and your .env lacks (missing), names only your .env has (add them to the example without their values), and names that are empty in your .env.

Does it find leaked secrets?

It points out names that look like secrets so that you keep the file out of version control. To find keys and tokens in code and committed files, use the Secret Scanner.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.