1. Home
  2. Developer tools
  3. .env Formatter & Converter

.env Formatter & Converter

Move configuration from a local .env file to Docker, Kubernetes or CI without retyping every variable, and catch duplicates and secrets on the way.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use .env Formatter & Converter

  1. Paste a .env file (or JSON, Compose or a ConfigMap).
  2. Choose the target format.
  3. Copy or download the result.

Features

  • dotenv parsing: export, comments, quotes, multi-line values
  • Warnings for duplicate keys and non-standard names
  • Flags keys that look like secrets
  • Compose (map or list), docker run, ConfigMap, Secret (base64), GitHub Actions, JSON, shell, PowerShell
  • Reads the other formats back into .env

Supported formats

You can open

  • ENV
  • JSON
  • YAML

You get

  • YAML
  • JSON
  • ENV
  • SH

Private by design

Your files are opened and processed by your browser on this device. They are never uploaded to openWorkstand or anyone else, so the .env Formatter & Converter is safe for contracts, IDs, photos and work documents. After you have used it once while online, it also works without an internet connection. How local processing works

Guide

From a .env file to Docker, Kubernetes and CI

Applications read configuration from environment variables, and during development those usually live in a .env file. When the app moves to Docker, Kubernetes or a CI pipeline, the same variables have to be written again in a different syntax — and every copy is a chance to mistype a key or leak a secret. This converter reads a .env file, checks it, and writes it in the format you need.

The .env syntax

There is no formal standard, but the popular dotenv libraries agree on the basics, and the parser follows them. Each line is KEY=value, optionally preceded by export. Blank lines and lines starting with # are ignored, and a # after an unquoted value starts a comment. Single-quoted values are taken literally. Double-quoted values understand escapes such as \n and may span several lines, which is how private keys and certificates are often stored.

Checks on the way

Every problem is listed with its line number. A line that is not KEY=value is an error. Names with characters other than letters, digits and underscores are flagged, because many shells and platforms reject them, and lower-case names get a gentle note since upper case is the convention. A key defined twice is the most common mistake: the tool keeps the last value, as most loaders do, and warns so you can remove the stale line.

Spotting secrets

Keys whose names contain words like PASSWORD, SECRET, TOKEN, KEY, PRIVATE, CREDENTIAL, AUTH or DSN are counted as likely secrets and named in a warning when you convert to a format that should not hold them, such as a ConfigMap or a Compose file committed to a repository.

The target formats

Docker Compose accepts environment variables as a map (PORT: "8080") or a list (- PORT=8080); both are offered, with values quoted where YAML would misread them. The docker run output gives one -e flag per variable, shell-quoted. Kubernetes gets a ConfigMap for plain settings or a Secret, whose values are base64-encoded as the API requires. The GitHub Actions output writes ordinary values directly and replaces likely secrets with ${{ secrets.NAME }} references, ready for repository secrets. JSON, shell export lines and PowerShell $env: assignments complete the set.

Base64 is not encryption

A Kubernetes Secret only encodes values; anyone who can read the object can decode them, as this tool does when you paste one back. Protect Secrets with role-based access control, enable encryption at rest in the cluster, or use an external secret manager.

A worked example

The sample defines PORT twice, so the checks report “PORT is defined twice (line 3)” and the output uses 8080. Seven variables remain, one of them — STRIPE_SECRET_KEY — flagged as a likely secret. In the Compose map, the database URL is quoted because it contains a colon, and as a Kubernetes Secret, PORT becomes ODA4MA==.

Converting back

The tool also reads the other formats: paste JSON, a Compose environment list, a ConfigMap or Secret, or a docker run command, and the variables are extracted so you can produce a clean .env or another target.

Convert configuration files with the TOML Converter and YAML to JSON, decode or encode values with the Base64 Encoder, or tidy JSON settings in the JSON Formatter.

Checked against the current version of the .env Formatter & Converter on .

Troubleshooting

The file does not open

Check that it is one of the supported formats above and opens in another app. Damaged files and password-protected PDFs cannot be read until they are repaired or unlocked.

It is slow or stops on a very large file

Everything runs on your device, so speed depends on its memory. Close other tabs, use a computer rather than a phone, or split the file into smaller parts first.

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

Should I commit my .env file?

No. Commit a .env.example with the variable names and safe placeholder values, and keep real values out of version control with .gitignore. Leaked keys in public repositories are found by automated scanners within minutes.

Why are some Compose values in quotes?

YAML would otherwise read them as other types: 8080 as a number, true or yes as a boolean, and values with a colon or # as something else entirely. Quoting keeps every value a string, which is what environment variables are.

Can I convert a Kubernetes Secret back to .env?

Yes. Paste the Secret manifest and its base64 data values are decoded into KEY=value lines, which you can then convert to any other format.

Is a Kubernetes Secret encrypted?

Not by itself. Values are base64-encoded, which anyone with access can decode. Protect Secrets with RBAC, enable encryption at rest in the cluster, or use an external secret manager.

Which value wins when a key appears twice?

Most loaders, including Docker Compose and dotenv, use the last definition. The tool keeps the last value and warns about the duplicate so you can delete the stale one.

Keep working with the result

After you download, choose “Save to Workstand” to keep the result in a folder on your computer, attach it to a project and create a follow-up task. It is saved by your browser, not uploaded.