Dotenv To Json
Free online dotenv to json tool, no installation required
About Dotenv to JSON Converter
Converts .env files (KEY=value lines) into a pretty-printed JSON object. Lines starting with # and blank lines are skipped, and any line without an = is ignored. Values are kept as strings — numbers, booleans and quotes are not coerced.
How to Use
1. Paste your .env contents into the Input box (e.g. PORT=3000 on each line) 2. Click Convert to parse every KEY=value pair 3. Review the resulting JSON in the Output box, formatted with 2-space indentation 4. Click Copy to copy the JSON, or Clear to reset both fields
Parsing Rules
Lines are trimmed before parsing, so leading/trailing whitespace around KEY and value is removed. Comments (#...) and empty lines are ignored. Only the first = on a line is treated as the separator, so values may contain = characters. Duplicate keys overwrite earlier ones.
▶Are numbers and booleans converted to their JSON types?
▶What happens to inline comments like KEY=val # note?
▶Are quoted values unquoted?
▶Does it handle multi-line values?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee