← All Tools

JSON to .env Converter

Flatten a nested JSON config into KEY=value lines for .env files, docker --env-file, Kubernetes ConfigMap / Secret stringData, or shell export statements. Customize the path separator, prefix, casing, quoting, and how arrays and nested objects are flattened.

keys 0 max depth 0 quoted 0 skipped 0

Notes on flattening

Environment variables are a flat string-to-string map, so any structure has to be encoded into the key path. The default UPPER_SNAKE with _ separator follows the convention used by dotenv, Kubernetes ConfigMaps, and most cloud platforms. The double-underscore (__) separator is what ASP.NET Core configuration providers expect for nested keys. Quoting only kicks in when a value contains whitespace, #, =, or non-printable characters — bare values (5432, true) are left unquoted, the way parse_env in most languages prefers. Booleans and numbers serialize as their literal string form (true, not 1); flip skip null to suppress missing values rather than emitting KEY=.