Convert a .env file to JSON and JSON back to .env, in both directions, entirely in your browser.
How to use the ENV / JSON
Choose a direction: .env to JSON or JSON to .env.
Paste your .env contents or a JSON object.
Copy the result, or swap to convert back.
A two-way converter between .env files and JSON. Turn a .env file into a JSON object to inspect or edit it, or turn JSON back into a valid .env file, handling comments, the export prefix and quoted values.
Converting to JSON is useful for bulk-editing config, diffing two environments, or feeding settings into a tool that expects JSON; converting back produces a ready-to-use .env.
Because .env files hold secrets, privacy matters: the conversion runs entirely in your browser, so your environment variables and any keys in them never leave your device.
A .env file is the simple KEY=value list that apps load to configure themselves, database URLs, API keys, feature flags, kept out of the code and out of version control. It is the standard way to separate configuration from an application.
When reading a .env, comment lines starting with # and blank lines are ignored, an optional export prefix is removed, and surrounding quotes are stripped from values, so the JSON you get is clean and exactly the key-value pairs.
When writing a .env, values that contain spaces or special characters are wrapped in double quotes so they parse correctly in a shell or a dotenv loader, which avoids a common source of broken configuration.
Frequently asked questions
Comment lines starting with # and blank lines are ignored, an optional export prefix is removed, and surrounding quotes are stripped from values.
When writing .env, values containing spaces or special characters are wrapped in double quotes so they parse correctly.
No. The conversion runs entirely in your browser, so your environment variables never leave your device.
A plain-text list of KEY=value pairs that an application loads as configuration, such as database URLs and API keys, keeping settings separate from the code.
The tool processes everything locally in your browser and uploads nothing, so it does not transmit your values. As always, take care on shared or public computers.
Embed this tool
Add this tool to your own website. Copy the snippet below; it stays up to date automatically.
<iframe src="https://monu.tools/embed/en/env-json-converter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>Related tools
Generate an HMAC for a message and secret key using SHA-1, SHA-256, SHA-384 or SHA-512, in your browser.
Hash a password with bcrypt and verify a password against a bcrypt hash, entirely in your browser.
Convert a curl command into equivalent JavaScript fetch code, entirely in your browser.
Convert JSON to TOML and TOML back to JSON, in both directions, entirely in your browser.