Skip to content

Tools/.env ↔ JSON

.env ↔ JSON

Turn dotenv files into JSON and back. Nothing is uploaded.

Also: .env to JSON · JSON to .env

Loading tool…

How to use .env ↔ JSON

  1. 1. Paste a .env. Comments and blank lines are skipped.
  2. 2. Or paste JSON. Keys become KEY=value lines.
  3. 3. Copy. Do not commit secrets.
  4. 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

Frequently asked questions

Related tools

All tools