.env to JSON Converter
Convert a .env file to JSON and back with two live, editable boxes — runs 100% in your browser with no upload.
🔒 Converted in your browser — nothing is uploaded.
Turn a .env file into JSON, and JSON back into .env
Paste the contents of a .env file into the left box and get a clean JSON object of every key–value pair on the right. Edit either side and the other updates live, so it works both ways: you can also paste a JSON object and get a ready-to-save .env file. Every value is kept as a string, blank lines and # comment lines are ignored, and each line is split on the first = so URLs and values that themselves contain an equals sign stay intact. A leading shell export keyword is dropped, so files meant to be source-d (export DB_HOST=localhost) parse to a clean key.
Quotes and spaces handled correctly
When reading a .env file, one layer of matching surrounding quotes is stripped, so API_KEY="s3cr3t token" becomes the value s3cr3t token while the spaces inside are preserved. Going the other way, any value that contains whitespace is automatically wrapped in double quotes so the generated .env stays valid and round-trips cleanly. Copy either box with a single click.
Frequently asked questions
Is my .env file uploaded anywhere?
No. The entire conversion runs locally in your browser with JavaScript. Your keys, secrets, and values never leave your device and nothing is sent to a server, so even production credentials stay private.
How are quotes and comments handled?
Lines that are blank or start with # are ignored. For each remaining line the key and value are trimmed, and one layer of matching surrounding single or double quotes is removed from the value. All values are kept as strings — no numbers or booleans are inferred.
Can I convert JSON back into a .env file?
Yes. Edit the JSON box and the .env box updates instantly. Provide a flat object of key–value pairs; values are coerced to strings, and any value containing spaces is wrapped in double quotes so the result is a valid .env file.