Skip to content
migration.tools
.env to JSON, YAML, K8s, Terraform…

.env file converter

Every platform wants the same environment variables in a different shape. Convert a .env file into whatever your new host expects — and since these files hold credentials, do it somewhere that never sends them over the network.

Options

Variables

Converted

The result appears here as soon as there is input.

Processed on this device. Nothing you paste or drop is uploaded.

How to use it

  1. 1Paste your .env or drop a file onto the input panel.
  2. 2Adjust the options — the result updates as you type.
  3. 3Copy the JSON, YAML, K8s, Terraform… or download it. Drop several files to convert a batch into one ZIP.

Parsing rules

The parser follows dotenv conventions: export prefixes are ignored, double-quoted values understand \n and may span lines, single-quoted values are literal, and a # starts a comment only when it follows whitespace — so a URL fragment or a password containing # survives.

Going the other way, nested JSON or YAML is flattened with underscores (database.host → DATABASE_HOST), and Kubernetes ConfigMaps and Secrets are read directly, with Secret values base64-decoded.

Output formats

Kubernetes Secret output base64-encodes each value as the API requires; ConfigMap output keeps them readable. Shell, Docker, Heroku and Fly.io outputs quote each value so spaces and special characters reach the platform intact.

GitHub Actions output references each variable as a repository secret rather than embedding the value, which is what you want in a workflow file you are going to commit.

Questions

Are my secrets sent anywhere?

No. Parsing and conversion happen in JavaScript on this page. There is no server-side step, and the page works with your network disconnected.

Does base64 in a Kubernetes Secret protect the values?

No. Base64 is an encoding, not encryption — anyone with the manifest can decode it. Don't commit Secret manifests; use Sealed Secrets, SOPS or an external secrets operator.

Guides that use this tool