.env to JSON
Convert between .env files and JSON in both directions.
Designed to run in your browser. See the privacy policy.
About .env to JSON
This tool converts between dotenv files and JSON in both directions. In ".env → JSON" mode it reads KEY=value lines and produces a JSON object, which is handy for pasting environment settings into a cloud console, a secrets manager import, a test fixture or a config file. In "JSON → .env" mode it turns a flat JSON object back into a .env file you can drop into a project.
.env files often hold API keys, database passwords and tokens. The conversion is designed to run in your browser, so the text is processed on your device rather than on a conversion server. Even so, treat any page you paste secrets into with care, and consider replacing real secrets with placeholders when you only need the structure.
How to use
- Choose the direction at the top: ".env → JSON" or "JSON → .env".
- Paste the contents of your .env file, or a JSON object, into the input box.
- Check the output panel; if something cannot be converted, an error message explains why.
- Copy the result, or download it as output.json or as a file named .env.