.env ↔ JSON Converter
Convert dotenv files to JSON and back — with secret masking
How it works
- 1Paste .env or JSON
Drop either format — the tool converts in the direction you pick.
- 2Toggle secret masking
Turn on to replace values of KEY / TOKEN / PASSWORD variables with ***, so you can share the config safely.
- 3Copy 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
.env files in 2026: parsing, secrets management, and portability
Every framework reads .env slightly differently. Here's the shared subset that works everywhere, the security pitfalls, and how to sync .env with JSON, YAML, and cloud secret stores.
TOML vs YAML vs JSON: picking a config format in 2026
Rust picked TOML. Python packaging picked TOML. Cloudflare Workers picked TOML. Here's why the config landscape shifted, and how to move between TOML, YAML, and JSON without breakage.
Related tools
JSON to CSV
Convert JSON arrays to downloadable CSV
Timestamp Converter
Convert between Unix time, ISO 8601, and human-readable dates
Markdown to HTML
Convert Markdown to clean HTML with live preview
YAML ↔ JSON
Convert YAML to JSON and back with full syntax validation
JSON → TypeScript
Generate TypeScript interfaces or types from a JSON sample
Base Converter
Convert between binary, octal, decimal, and hexadecimal