Convert .env to JSON and Back
Paste a .env file to turn its KEY=VALUE pairs into clean JSON, or paste JSON to build a .env file. Comments, blank lines, an optional export prefix and quoted values are all handled.
How to convert .env to JSON
- Paste your .env contents or your JSON into the box.
- Pick the direction: to JSON or to .env.
- Copy the converted result.
Examples
.env to JSON
# database export DB_HOST=localhost DB_URL="postgres://a=b@host"
{
"DB_HOST": "localhost",
"DB_URL": "postgres://a=b@host"
}Frequently asked questions
Does it keep equals signs inside values?
Yes. Only the first equals sign on a line splits the key from the value, so connection strings and tokens that contain = stay intact.
Are comments and blank lines ignored?
Yes. Lines that are blank or start with # are skipped, so your JSON only contains real variables.
What about the export prefix and quotes?
An optional leading 'export ' is stripped, and surrounding single or double quotes are removed from values.
Will every value be a string?
Yes. Environment variables are always strings, so numbers and booleans are kept as quoted strings in the JSON output.
Is my data private?
Yes. The conversion runs entirely in your browser and nothing is uploaded.
Related tools
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
CSV to JSON
Convert CSV to JSON online. Turn spreadsheet rows into clean JSON objects or arrays, with smart number and boolean typing. Free tier plus API.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
Aspect Ratio Calculator
Calculate aspect ratios fast. Enter a ratio like 16:9 and one dimension to get the other, or enter width and height to simplify the ratio.
Base32 Encode
Base32 encode and decode text online using the standard RFC 4648 alphabet with proper padding. UTF-8 safe, fast and private in your browser.
Base58 Encoder
Encode and decode Base58 online with the Bitcoin alphabet. Convert text to Base58 or back, UTF-8 safe, no confusing 0 O I l. Runs in your browser.