.env to JSON Converter

Turn a .env file into JSON, or JSON config into .env variables. Your secrets never leave your browser.

FreeNo sign-upPrivate — runs in your browser
0Variables
0Comments
0Duplicates

How to use the .env to JSON Converter

  1. Paste your .env or JSONChoose the direction, then paste the file or open it. Opening a JSON file switches the direction for you.
  2. Set the optionsFor .env → JSON, choose whether numbers and true/false become real JSON types. For JSON → .env, nested keys are joined with _ and can be made UPPER_CASE.
  3. Copy or downloadCopy the result, or download it as env.json or .env.

Example

export PORT=3000 becomes "PORT": "3000" (or 3000 with “Convert numbers” on). The comment after DB_POOL=10 # max connections is removed.

From JSON, {"database": {"url": "…"}} becomes DATABASE_URL=…, and the list of hosts becomes ALLOWED_HOSTS=example.com,www.example.com.

Frequently asked questions

Which .env syntax is supported?

KEY=value lines, export KEY=value, # comments (full-line and after unquoted values), single and double quotes, \n escapes inside double quotes, and quoted values over several lines, as used by dotenv.

Is it safe to paste secrets?

Yes. The conversion happens entirely in your browser and nothing is uploaded or stored. Still, avoid pasting production secrets on shared computers.

How are nested JSON objects converted?

Keys are joined with underscores: {"database": {"url": "x"}} becomes DATABASE_URL=x. Arrays of simple values are joined with commas; arrays of objects use the index, such as SERVERS_0_HOST.

Popular posts from this blog

Character Counter

Speech to Text Online

Keyboard Tester