.env → JSON Converter
Convert .env files to a JSON object locally. All values remain strings — the .env format has no type system. Quotes are stripped, comments dropped.
How the conversion works
Each key/value pair becomes a JSON string property. Quotes are stripped from values before output. Inline comments are dropped. Only the first occurrence of a duplicate key is included.
Input
APP_NAME="My App" DB_PORT=5432 # default port APP_DEBUG=false
Output
{
"APP_NAME": "My App",
"DB_PORT": "5432",
"APP_DEBUG": "false"
}Note: All values are JSON strings —
"5432", not 5432. The .env format has no type system.Frequently Asked Questions
Your files stay on your computer. Dad promised.