.env ⇆ JSON Converter
Convert between .env files and JSON objects
Convert a .env file into a clean JSON object, or turn a JSON object back into .env lines — handy when moving configuration between a local dotenv file and a secrets manager, CI variable block, or application config. It understands comments, the optional export prefix, and quoted values, and it coerces obvious booleans and numbers. Conversion runs entirely in your browser.
How to use .env ⇆ JSON Converter
- Choose a direction: .env to JSON, or JSON to .env.
- Paste your .env contents or JSON object into the input.
- Read the converted result in the output pane.
- Copy the result, or use Swap to round-trip in the other direction.
Frequently asked questions
Does it handle comments and the export prefix?
Yes. Lines beginning with # are ignored, blank lines are skipped, and a leading 'export ' is stripped so that 'export KEY=value' parses correctly.
Are values typed when converting to JSON?
Values that look like true, false, or a number are coerced to the matching JSON type; everything else stays a string. A single surrounding pair of quotes is removed.
Is my configuration sent anywhere?
No. Parsing and conversion happen locally in your browser, so secrets in your .env never leave your device.
Related Data & Formatting tools
- JSON Formatter — Format, minify, validate, and beautify JSON data
- JSON Diff — Compare two JSON documents and see exactly what changed
- XML ⇆ JSON Converter — Convert between XML and JSON formats
- YAML ⇆ JSON Converter — Convert between YAML and JSON formats
- CSV to JSON Converter — Convert between CSV and JSON formats
- JSON to C# Classes — Generate C# classes from JSON data