.env to JSON Converter

Parse dotenv files into JSON, privately in your browser.

100% Client-Side Processing — your data never leaves this browser. Works offline. How it works

0 lines • 0 bytes Ready
Tip: drop a file anywhere on the editor
Input
Paste, type or drop a file
1
Result
Updates as you type
// Output will appear here…
About this tool

How the .env to JSON works

Convert .env (dotenv) files to JSON. Handles comments, export prefixes, quoted and multi-line values, and optional nesting on double underscores.

How to use the .env to JSON

  1. Paste the .env file or upload it.
  2. Choose whether to detect types and nest keys on __.
  3. Copy or download the JSON.

.env to JSON example

Input
# Local settings
PORT=8080
DATABASE_URL="postgres://localhost:5432/app"
export DEBUG=true
Result
{
  "PORT": "8080",
  "DATABASE_URL": "postgres://localhost:5432/app",
  "DEBUG": "true"
}

When to use it

  • Comparing environment files between staging and production.
  • Moving settings into JSON-based config or secret managers.
  • Documenting which variables an app needs.

Tip: Use JSON to .env to go the other way when you need to write an env file from a config object.

Dotenv syntax

Comments, export prefixes, empty values and inline # comments after unquoted values.

Quoted values

Double quotes support \n escapes and multiple lines; single quotes are taken literally.

Optional typing

Keep every value as a string (as process.env does), or detect numbers and booleans.

Nesting

Turn DATABASE__HOST into {"DATABASE": {"HOST": ...}} with the double-underscore option.

FAQ

Common questions

Is it safe to paste secrets?

The file is parsed in your browser and nothing is uploaded. As with any tool, avoid pasting production secrets on shared computers.

Why are numbers strings by default?

Environment variables are always strings; that matches what your app receives. Turn on detection if you need typed JSON.

Is variable expansion supported?

No. ${OTHER_VAR} is kept as written, so you can see exactly what the file contains.

Which formats work?

Files used by dotenv for Node.js, python-dotenv, Docker Compose env_file and most frameworks.