Too Much Tools logoToo Much Tools

appsettings.json ↔ Environment Variables

Convert .NET appsettings.json to environment variables (and back) for Docker, Kubernetes and CI.

Local, Runs entirely in your browser, your data never leaves your device.
Loading tool…

Turn appsettings.json into environment variables for containers

ASP.NET Core's configuration provider maps nested appsettings.json keys to environment variables by joining segments with a double underscore, so Jwt:Issuer becomes Jwt__Issuer. This tool flattens a pasted JSON file into that shape, or the reverse: it rebuilds nested JSON from a list of KEY__SUBKEY=value lines. Everything runs in the browser, so config containing connection strings or secrets never leaves your machine.

How to use the appsettings.json ↔ Environment Variables

  1. Paste your appsettings.json into the left panel, or click Example to load a sample with a connection string, nested Jwt section and an array.
  2. Choose an output format from the dropdown: double underscore, .NET's colon notation, .env, bash export, PowerShell, Docker Compose, or a Kubernetes ConfigMap.
  3. Switch to Env → JSON to paste existing KEY__SUBKEY=value or Key:SubKey=value lines and rebuild the nested appsettings.json structure.
  4. Copy the output or use Send To to push it straight into another tool, such as the connection string parser.

Arrays flatten to indexed keys, so Cors:Origins:0 and Cors:Origins:1 (or Cors__Origins__0 in double-underscore form) each become a separate variable, matching how the .NET configuration binder reads array-shaped settings.

Reverse parsing (Env → JSON) auto-detects the separator per key: it splits on __ if present, otherwise on a colon, and coerces true/false, integers and decimals to their JSON types rather than leaving everything as strings.

Frequently asked questions

Why does .NET use double underscores instead of colons for env vars?
Colons are invalid or awkward in environment variable names on Bash, Docker and Kubernetes, so the .NET configuration provider treats a double underscore as equivalent to a colon separator specifically for environment variable sources.
Can I generate a Kubernetes ConfigMap directly from appsettings.json?
Yes, select the Kubernetes ConfigMap format and the tool outputs a data block with double-underscore keys and quoted string values, ready to paste into a ConfigMap manifest or apply with kubectl.
Does converting my appsettings.json upload it anywhere?
No, the flattening and rendering happen with plain JavaScript in your browser tab, so a file containing a database password or API key is never sent to a server, even though the input box accepts it.
How are nested arrays and objects handled?
Objects flatten by joining each key in the path with the chosen separator, and array items use their numeric index as a path segment, so Features.Flags[0].Name becomes Features__Flags__0__Name in double-underscore output.