ubin.sh

.env to JSON Converter

Convert .env files to JSON and JSON back to .env, right in your browser.

Converted in your browser — nothing is uploaded, and this input is not saved to localStorage.

About this tool

Secret stores want JSON, your project has a .env. Paste the file and get a flat JSON object of string values — quoted values, multi-line values, `export` prefixes, and `#` comments are all handled the way dotenv handles them. Minify it to one line and it drops straight into Google Secret Manager, AWS Secrets Manager, a Kubernetes secret, or a GitHub Actions secret.

The reverse direction turns a JSON object back into .env lines for local development, quoting only the values that need it and keeping nested objects as compact JSON. Values are converted in your browser and never uploaded — and unlike the other tools here, the input is not saved to localStorage, so it disappears when you close the tab.

Frequently asked questions

How do I get a .env into Secret Manager?

+

Convert it here, pick “Minify” so the JSON is a single line, and store that as the secret value — Google Secret Manager, AWS Secrets Manager, and Vault all take an arbitrary JSON string. Your app then reads one secret and parses it instead of juggling one secret per variable.

Are values converted to numbers or booleans?

+

Not by default: every value stays a string, which is what secret stores and process.env expect. Turn on “Infer types” if you want true/false, numbers, and null to become real JSON types.

Does it expand ${VAR} references?

+

Only if you ask it to. With “Expand ${VAR}” on, references are resolved against keys defined earlier in the same file, including ${VAR:-default}; single-quoted values are left literal, as in dotenv. With it off, the raw text is kept.

What about quotes, comments, and multi-line values?

+

Double-quoted values get their escapes (\n, \t, \") decoded, single-quoted and backtick values stay literal, and a quoted value may span several lines. Full-line and trailing # comments are dropped, and duplicate keys keep the last value — the same rules dotenv follows.

Is my .env uploaded anywhere?

+

No. Everything runs client-side in your browser, there is no request to a server, and the input is deliberately not persisted to localStorage the way other tools on this site do.