JSON to .env Converter
Example
Input:
{"db": {"host": "localhost"}, "port": 5432}Output:
DB_HOST=localhost PORT=5432
About this converter
.env files are the twelve-factor way to configure apps: flat KEY=value lines read by everything from Docker to Node's dotenv. Flattening JSON into that world needs conventions, stated here: nested objects join with underscores and uppercase (db.host → DB_HOST), arrays become comma-separated values, and values containing spaces, # or quotes are double-quoted with escapes, because an unquoted # starts a comment in most .env parsers and would silently truncate your secret. Booleans become true/false strings — .env has no types, and pretending otherwise is how "false" ends up truthy in a shell script.
Frequently Asked Questions
Why was my value quoted?
It contains a space, #, quote or $ that .env parsers would misread. The quotes keep the value intact.
Are the values typed?
No — .env is strings all the way down. Your application must parse "5432" into a number itself.