Skip to content
Categories
Env File Validator
Validate the syntax and duplicate keys of .env-formatted text.
Overview
- Paste .env-formatted text (a list of KEY=VALUE lines) to check for syntax errors, duplicate keys, and unclosed quotes.
- Checks whether each line is in "KEY=VALUE" format, whether key names contain only letters, digits, and underscores, whether the same key is defined more than once, and whether quotes are properly closed.
- The text you enter is never sent anywhere — validation happens entirely in your browser.
Usage
- Paste the .env-formatted text you want to validate into the input field.
- Click the "Validate" button.
- The line number and details of each issue found are listed. If there are no issues, "No issues found." is displayed.
Example
Input
API_KEY=abc123 DEBUG=true API_KEY=xyz789
Output
Line 3: The key "API_KEY" is already defined on line 1 (duplicate).
Use Cases
- Checking for syntax mistakes or duplicate keys when reviewing a .env file created by someone else
- Checking that a file like .env.example is correctly formatted before wiring it into CI/CD
- Self-checking a manually edited .env file for mistakes before committing it
FAQ
Which .env syntax is supported?
Lines in "KEY=VALUE" format, comment lines starting with "#", blank lines, and a leading "export " prefix are all supported. Values may also be wrapped in single or double quotes.
Are multi-line values supported?
No. Only the common .env syntax of one KEY=VALUE pair per line is supported.
Is the .env content I enter (such as API keys) sent anywhere?
No. Validation happens entirely in your browser, and the content you enter is never sent to a server.
Notes
- This tool only checks syntax and does not interpret dotenv-library-specific extensions such as variable expansion ($VAR or ${VAR}).
- Multi-line values are not supported. This tool targets the common .env format of one KEY=VALUE pair per line.
- "Duplicate key" is treated as a warning, while "not in KEY=VALUE format", "invalid key name", and "unclosed quote" are treated as errors.
Related Tools
Select languages and tools to generate a .gitignore file.
Validate whether JSON is correctly formatted.
Convert JSON into YAML format.