Convert .env to JSON
Parse dotenv files
to JSON instantly.
Parse any .env
file to JSON. Handles quoted values, comments,
numbers, booleans and JSON array values.
Runs entirely in your browser.
.env parsing rules
How each .env line is parsed to a JSON value.
| .env line | JSON output | Notes |
|---|---|---|
HOST=localhost | "HOST": "localhost" | Unquoted string |
PORT=5432 | "PORT": 5432 | Integer (type inference on) |
DEBUG=true | "DEBUG": true | Boolean |
KEY= | "KEY": "" | Empty value → empty string (same as dotenv) |
MSG="hello world" | "MSG": "hello world" | Quoted — spaces preserved, quotes stripped |
TAGS=["a","b"] | "TAGS": ["a", "b"] | JSON array value parsed |
# comment | — | Comment lines ignored |
export KEY=val | "KEY": "val" | export prefix stripped |
Multi-line values, export and other dotenv rules
The parser follows the same rules as dotenv: an optional export prefix is ignored, values in double, single or backtick quotes can span several lines, # starts a comment only outside quotes, and an empty value (KEY=) becomes an empty string. Numbers with leading zeros stay strings.
Other config formats: INI to JSON, TOML to JSON and YAML to JSON. To go back, use JSON to .env.
All data & config formats tools
.env parsed in your
browser. No upload.
The parser handles all standard dotenv formats: unquoted values, double-quoted and single-quoted strings with escape sequences, inline comments (stripped), blank lines (ignored), and the optional export prefix. Values that look like JSON arrays or objects are parsed as JSON.
