AZ Tools

.env File Parser

File

A robust browser-based parser for `.env` files that handles the real-world quirks: single vs double quotes (escape sequences only resolve in double quotes), multi-line values for things like RSA private keys, inline `# comments` after values, `export FOO=bar` prefixes, and empty values. Once parsed, export the result in the format your next environment needs — JSON for testing, YAML for Kubernetes/Helm, `export` lines for shell scripts, `ENV` directives for Dockerfiles, or TOML blocks for Netlify environment contexts.

.env file contents
Parsed entries (10 entries)
KeyValueInline comment
DATABASE_URL
postgres://user:pass@localhost:5432/mydb
DB_POOL_SIZE
10
APP_NAME
My App
APP_VERSION
1.0.0
APP_DEBUG
true
OAUTH_PRIVATE_KEY
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAxYz...
-----END RSA PRIVATE KEY-----
ROOT_DIR
/opt/app
LOG_DIR
${ROOT_DIR}/logs
EMPTY
PORT
3000
default port
Export as:
Output
{
  "DATABASE_URL": "postgres://user:pass@localhost:5432/mydb",
  "DB_POOL_SIZE": "10",
  "APP_NAME": "My App",
  "APP_VERSION": "1.0.0",
  "APP_DEBUG": "true",
  "OAUTH_PRIVATE_KEY": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxYz...\n-----END RSA PRIVATE KEY-----",
  "ROOT_DIR": "/opt/app",
  "LOG_DIR": "${ROOT_DIR}/logs",
  "EMPTY": "",
  "PORT": "3000"
}

Variable expansion (${VAR}) is preserved literally — not resolved. Add a runtime expander if needed.

How to use

  1. Paste your `.env` file (or load the sample to see all supported syntax).
  2. Review the parsed key/value/comment table.
  3. Pick an export format and copy. Multi-line values are preserved (YAML uses `|`, Docker uses JSON-escaped string).

Frequently asked questions

What's the difference between single and double quotes?
Inside double quotes, escape sequences like `\n`, `\t`, `\"` are interpreted. Inside single quotes, they're literal — so `FOO='line1\nline2'` keeps the backslash-n. This matches the standard dotenv behavior used by `dotenv` (npm) and `python-dotenv`.
Does this expand `${VAR}` references?
No — variable expansion is dotenv-implementation-specific and we want the parser output to faithfully represent the file as written. Use a tool like `dotenv-expand` after import if you need it.
Is the data sent anywhere?
No. Parsing happens entirely in your browser. The `.env` file content never leaves your device.

Related tools