Code converter

.env to JSON converter

To convert .env to JSON, drop your .env file in the box below. It converts straight away; press Download to save the JSON. It all happens in your browser, so your file stays on your device.

Converted on this device, never uploaded

What changes

.env to JSONWhat happens
RulesAs dotenv reads them: export, quotes, escapes in double quotes, multi-line values, # comments
${VAR}Kept as written, never filled in
Set twiceThe last value counts, and the note names the key
Lines that are not KEY=valueLeft out, named by line in the note

How to convert .env to JSON

  1. Add your .env. Drop the file in the box, or click to choose it. It becomes JSON straight away.
  2. Check the result. Look at the preview and the size. The defaults are right for most files.
  3. Download. Press Download to save the JSON.
Why JSON

See every variable in a .env file as one JSON object, for a deployment tool, a secrets store or a check.

Questions

It is converted in your browser and never uploaded. The JSON has the same secrets as the .env, so keep it as private.

Every value is text unless “Numbers and true/false as values” is on: then PORT=3000 becomes 3000.

No. The conversion happens right in your browser, so your file stays on your device. There is no account to make, either.

Related conversions