.env to JSON Converter
Paste a .env file to get clean JSON, or flip the direction to turn JSON back into dotenv lines. Comments and blanks are dropped, quotes are stripped and export is handled. Your secrets stay in your browser.
How to convert .env to JSON
- Paste your .env file (or JSON object) into the editor.
- Pick a direction: .env to JSON, or JSON to .env.
- Copy the result or download it as a file.
Examples
Dotenv to JSON
PORT=3000 # comment NAME="My App" export TOKEN=abc
{
"PORT": "3000",
"NAME": "My App",
"TOKEN": "abc"
}Frequently asked questions
Are my secrets uploaded anywhere?
No. The conversion runs entirely in your browser, so the values in your .env file never leave your device or get sent to a server.
How are comments and blank lines handled?
Lines starting with # are treated as comments and dropped, and blank lines are ignored. Only KEY=value lines end up in the output.
Does it support the export prefix?
Yes. A leading 'export ' (as in export KEY=value) is recognised and removed, so the key comes out clean.
What about quotes and values that contain an equals sign?
A single pair of surrounding single or double quotes is stripped from each value. Values keep everything after the first equals sign, so URL=postgres://a=b stays intact.
Are numbers and booleans converted to real types?
No. Dotenv values are always strings, so PORT=3000 becomes the string "3000". This matches how process.env behaves at runtime.
Can I convert JSON back into a .env file?
Yes. Switch the direction to JSON to .env and the tool writes KEY=value lines, quoting any value that contains spaces.
Related tools
INI to JSON
Convert INI config to JSON online. Paste an INI file and get clean, nested JSON with sections as objects. Runs entirely in your browser.
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
JSON to YAML
Convert JSON to YAML online. Paste JSON and get clean, readable YAML with proper 2-space indentation. Fast, free and runs in your browser.
YAML to JSON
Convert YAML to JSON online. Paste YAML and get clean, pretty-printed JSON with the indentation you choose. 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.
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.