712Tools

.env ↔ JSON Converter

Convert dotenv files to JSON and back — with secret masking

🔒 100% in-browser🆓 Free forever⚡ No sign-up

How it works

  1. 1
    Paste .env or JSON

    Drop either format — the tool converts in the direction you pick.

  2. 2
    Toggle secret masking

    Turn on to replace values of KEY / TOKEN / PASSWORD variables with ***, so you can share the config safely.

  3. 3
    Copy the output

    One click sends the result to your clipboard.

About .env ↔ JSON Converter

Free online .env to JSON converter. Paste a dotenv file to get clean JSON, or JSON to get a properly quoted .env. Optional secret masking hides values for KEY, TOKEN, SECRET, PASSWORD, and API_* variables. Runs entirely in your browser. .env ↔ JSON Converter on 712 Tools runs entirely inside your browser using modern JavaScript APIs — no server ever sees your data. That means instant results, complete privacy, and no upload limits.

Whether you need to convert dotenv files to json and back — with secret masking for a debugging session, a quick sanity check, or a production incident, this tool is free to use as many times as you need. There are no watermarks, no sign-up, and no ads inside the tool itself.

Frequently asked questions

Which .env syntax is supported?

Standard dotenv: KEY=value, optional quotes (single or double), # comments, export prefix, and \n escapes inside double-quoted strings.

What triggers secret masking?

A regex against the key name: TOKEN, KEY, SECRET, PASSWORD, PASSWD, API, AUTH — case-insensitive. Never share masked output as a substitute for actual secret handling.

Does it handle multi-line values?

Multi-line values inside double-quoted strings using \n are supported. Raw multi-line values across lines aren't part of the dotenv spec.

Is my file uploaded?

No. Everything runs in your browser.

Read more