How to use .env ↔ JSON
- 1. Paste a .env. Comments and blank lines are skipped.
- 2. Or paste JSON. Keys become KEY=value lines.
- 3. Copy. Do not commit secrets.
- 4. Redact first. Use Secret redactor on shared machines.
About this tool
.env files are not JSON, but every app ends up wanting both. Parsing locally means a production dotenv dump never hits a formatter API.
Quotes and export
export KEY=value is accepted. Double quotes keep spaces. This is not a full bash parser.
Multiline values
A value with a real newline needs quotes. Prefer \n in JSON and expand in the app.
Code examples
env
API_URL=https://api.example.com
DEBUG=true