Env Variable Parser
Convert between .env, JSON, and YAML formats. Auto-detect secrets, copy, and download — all in your browser.
DB_HOST=localhost DB_PORT=5432 DB_NAME=myapp APP_NAME="My Application" DEBUG=false PORT=3000 API_KEY=*** DB_PASSWORD=***
What Are .env Files?
Environment variable files (.env) store configuration values outside your source code, keeping secrets like API keys, database URLs, and passwords separate from your application logic. They follow a simple KEY=value format and are loaded by tools like dotenv, Docker Compose, and most CI/CD platforms. The .env pattern is a key practice for twelve-factor application development and secure secret management.
How the Converter Works
Paste your environment variables in any supported format — .env, JSON, or YAML — into the input area. The tool auto-detects the format and converts to all three simultaneously. Lines starting with # are treated as comments and ignored. Quoted values with spaces are handled correctly. Variables containing names like PASSWORD, SECRET, KEY, or TOKEN are flagged with a warning badge and can be toggled between visible and hidden.
When to Use This Tool
Use this converter when migrating between configuration systems, onboarding new team members, or debugging environment setup issues. It is also useful when working with Docker Compose (which accepts YAML or .env format), Terraform variables, and GitHub Actions secrets. Converting from .env to JSON makes environment variables easy to store in parameter stores or secrets managers.
Format Examples
- .env: KEY=value (one per line, # for comments)
- JSON: {"KEY": "value"} (object of strings)
- YAML: KEY: value (no quotes needed for simple values)
- Multiword values: KEY="my value with spaces"
- Boolean-like: DEBUG=true (stored as string)