What is the appsettings.json to .env Converter?
The appsettings.json to .env Converter transforms ASP.NET Core configuration files into environment variable format (.env), making it easy to move settings between local development, Docker, and cloud deployments.
Why Convert appsettings.json to .env?
- Docker & containers: Container environments prefer flat environment variables over JSON files.
- 12-factor apps: The 12-factor methodology recommends storing config in environment variables for portability and security.
- CI/CD pipelines: Most CI/CD platforms (GitHub Actions, GitLab, Azure DevOps) inject config as environment variables, not files.
- Cloud hosting: Platforms like Azure App Service, Heroku, and Railway accept environment variables directly.
How ASP.NET Core Reads Environment Variables
ASP.NET Core's configuration system maps nested JSON keys to environment variables using double underscore (__) as a separator. For example:
ConnectionStrings:DefaultConnection→ConnectionStrings__DefaultConnectionJwt:Secret→Jwt__SecretLogging:LogLevel:Default→Logging__LogLevel__Default
This tool automatically applies that mapping so your converted variables work directly with ASP.NET Core's environment variable configuration provider.
File Type Presets
- appsettings.json: Base configuration shared across all environments.
- appsettings.Development.json: Overrides for local development (verbose logging, local DB connections).
- appsettings.Production.json: Overrides for production (restricted logging, production secrets).
Features
- Supports deeply nested JSON — flattened automatically with
__separator - Choose between double underscore, colon, or single underscore key separators
- Values with spaces or special characters are automatically quoted
- Load presets for Development or Production appsettings files
- Copy the result to clipboard in one click
- Fully client-side — your secrets never leave your browser
How to Use
- Select the file type (base, Development, or Production) from the settings panel, or paste your own JSON directly.
- Choose your preferred key separator (double underscore is the ASP.NET Core default).
- Click Convert or switch to the .env tab to see the result.
- Copy the output and paste it into your
.envfile or CI/CD pipeline secrets.