Convert .env files to JSON format instantly. Handles comments, quotes, multi-line values, export prefixes, and auto-types booleans and numbers.
Converting the example .env file produces:
{
"APP_NAME": "myapp",
"APP_PORT": 3000,
"APP_DEBUG": true,
"DATABASE_HOST": "localhost",
"DATABASE_PORT": 5432,
"DATABASE_NAME": "myapp",
"DATABASE_USER": "admin",
"DATABASE_PASSWORD": "secret",
"DARK_MODE": true,
"MAX_CONNECTIONS": 100,
"ALLOWED_ORIGINS": "https://example.com https://api.example.com",
"API_KEY": "sk-abc123xyz789",
"JWT_SECRET": "my-super-secret-key"
}
Notice how APP_PORT, DATABASE_PORT, and MAX_CONNECTIONS are converted to numbers, while APP_DEBUG and DARK_MODE become booleans. Comments are stripped automatically.
.env files use simple KEY=VALUE syntax with these conventions:
| Feature | Syntax | Example |
|---|---|---|
| Basic value | KEY=value |
APP_NAME=myapp |
| Quoted value | KEY="value with spaces" |
GREETING="hello world" |
| Empty value | KEY= |
EMPTY_VAR= |
| Comment | # text |
# This is a comment |
| Export prefix | export KEY=value |
export API_KEY=abc |
The parser handles all these variations and normalizes them to clean key-value pairs.
# docker-compose.env
POSTGRES_USER=admin
POSTGRES_PASSWORD=secret
POSTGRES_DB=myapp
REDIS_URL=redis://cache:6379
# .env.local
DATABASE_URL=postgresql://user:pass@host/db
NEXT_PUBLIC_API_URL=https://api.example.com
API_SECRET=sk-secret-key
# .env
NODE_ENV=production
PORT=3000
LOG_LEVEL=info
CORS_ORIGIN=https://example.com
Moving from a .env-based platform (Docker, Vercel) to a JSON-based system (Kubernetes ConfigMaps, AWS Parameter Store)? Convert first to validate the structure.
JSON is easier to validate programmatically. Convert your .env to JSON, then run it through a JSON schema validator to catch missing or malformed values.
JSON is more self-documenting for team members unfamiliar with a project’s environment setup. The type information (numbers vs strings) is explicit.
Unquoted values like NO, TRUE, FALSE may be interpreted as booleans by some parsers. Always quote values that should remain strings:
# Wrong - might be parsed as boolean
COUNTRY=NO
# Right - explicitly a string
COUNTRY="NO"
Multi-line values must be wrapped in quotes:
RSA_KEY="-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA0Z3VS5JJcds3xfn/ygWyF...
-----END RSA PRIVATE KEY-----"
Some .env parsers support ${VAR} syntax for variable references. This tool resolves references within the same file when possible.
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.