.env to JSON

Paste .env and get JSON at once, with errors pointed by line and column, then copy or download the result.

loading .env to JSON
About this tool

What are .env and JSON?

A .env file holds environment variables as KEY=value lines, one per line; frameworks and Docker load it into the process environment at startup. JSON is the text format of web APIs: objects in braces, lists in brackets, strings always in double quotes, and nothing else.

Handy for loading a .env into a JSON-based secret store or a cloud console (AWS Secrets Manager, Vercel, Netlify), or for comparing two environments as data.

This page opens the data converter already set to .env → JSON. Paste the text, read the result as you type, then copy it or download it as a file. Errors show the line and the column. Nothing is sent anywhere: the conversion runs in your browser.

.env vs JSON

.envJSON
Extension.env.json
Media typenone (plain text)application/json
Commentsyes (#)no
Data typestext onlystring, number, true/false, null, object, array
Nestingnone: flat keysany depth
Typical usesecrets and settings of apps, Docker, CIAPIs, package.json, logs
Specificationconvention (no formal spec)RFC 8259

When to convert .env to JSON

  • Convert to JSON when another program or an API will read the data.
  • Keep .env when the values go into environment variables of an app or a container.

What changes in the conversion

  • Comments of the .env file are not carried over: the converter reads the data, and comments are not data.
  • Every value is text (a .env has no numbers or booleans), quotes are removed, export prefixes are accepted and keys keep their exact spelling.

How to convert .env to JSON

  1. Paste your .env in the input box (the page opens with an example you can replace).
  2. Read the JSON on the right; it updates as you type. If something is wrong, the message says the line and column.
  3. Adjust the options if you need: indentation, sorted keys or type detection.
  4. Copy the result or download it as a .json file.

Example

This .env input:

# orders service
APP_NAME=orders
APP_PORT=8080
DATABASE_URL=postgres://db:5432/orders
DATABASE_POOL=10
GREETING="Olá, mundo"

becomes this JSON, exactly as the converter writes it:

{
  "APP_NAME": "orders",
  "APP_PORT": "8080",
  "DATABASE_URL": "postgres://db:5432/orders",
  "DATABASE_POOL": "10",
  "GREETING": "Olá, mundo"
}

Frequently asked questions

Is my .env sent to a server?

No. Conversion happens in your browser, so secrets in a config never leave your computer.

Does .env to JSON keep comments?

No. Comments are dropped because the converter works on the data itself. Copy important comments by hand; JSON itself has no comment syntax.

What happens to nested data?

.env nesting: none: flat keys. JSON nesting: any depth. The structure is kept as it is.

Report a problem