.env Formatter & Validator
Sort, dedupe, lint
Format, sort and validate .env files: catch duplicate keys, bad names and unquoted spaces, and convert to JSON or a .env.example. Secrets stay on your device.
# App APP_NAME=ToolWand app_env=production DATABASE_URL=postgres://user:pass@localhost:5432/db GREETING="hello world" PORT=8080 API_KEY=sk-test-123 1BAD=oops MULTI="line one\nline two"
9 variables · 2 errors · 5 warnings
- ! Line 3: app_env: convention is UPPER_SNAKE_CASE
- ! Line 3: app_env: spaces around = are not supported by every loader
- ! Line 6: GREETING: value contains spaces but is not quoted
- ! Line 7: PORT: duplicate (first on line 4); the last value wins
- ! Line 8: API_KEY: "export" prefix removed
- ✕ Line 9: 1BAD: invalid name (letters, digits, _ only; cannot start with a digit)
- ✕ Line 10: Not a KEY=value line: "not a valid line"
.env Formatter & Validator — Format, sort and validate .env files: catch duplicate keys, bad names and unquoted spaces, and convert to JSON or a .env.example. Secrets stay on your device. Free on ToolWand: no sign-up, no watermark, works offline.
How to use .env Formatter & Validator
- 1Open .env Formatter & Validator. It runs in your browser, no sign-up.
- 2Type or paste your input.
- 3Copy or download the result.
About .env Formatter & Validator
.env Formatter & Validator formats, sorts and validates .env files, catches duplicate keys, bad names and unquoted spaces, and converts to .env.example, JSON or YAML.
When to use it
- Clean up a messy .env before committing an example.
- Find why an app isn’t reading a variable.
- Share a .env.example with empty values.
Tips
- Most loaders like dotenv keep the last value for a duplicate key; deduping keeps the last one too.
- Secrets stay in your browser.
Questions
Are my secrets safe?
Yes. Everything runs in your browser — nothing is uploaded or stored.
What does .env.example do?
It keeps every key but empties the values, so you can commit it to show which variables the app needs.
Which value wins for duplicate keys?
Most loaders (like dotenv) keep the last one. Dedupe keeps the last value too.