.env File Parser & Validator — Instantly Audit Your Environment Variables
Parse .env files, detect duplicates, flag empty values, export as JSON or shell
Environment variable files are a common source of hard-to-debug deployment issues: a duplicate key that silently shadows another, a missing value that only fails at runtime, or quotes that are inconsistently applied across environments. This .env parser gives you a clean, tabular view of every variable in your file. Comments are stripped, quotes are normalised, and the tool flags duplicate keys in red and empty values in amber so problems are impossible to miss. Export the parsed variables as a JSON object (useful for API mocks and test fixtures) or as shell export commands (useful for sourcing in a terminal session).
How to Parse and Validate a .env File
Paste your .env content and immediately see a clean table with any issues highlighted.
Paste your .env file content
Copy the entire contents of your .env file and paste it into the text area. The parser handles all standard dotenv formats: KEY=value, KEY=quoted value with single or double quotes, comments starting with #, blank lines, and inline comments after the value. Nothing is sent to a server — the parsing happens entirely in your browser.
Review the parsed variable table
Each variable appears as a row with its key name and value. Rows with duplicate keys (a key that appears more than once) are highlighted in red — the first occurrence is kept, subsequent duplicates are flagged. Rows with empty values (KEY= with no value) are highlighted in amber as a warning. This makes it immediately clear which variables need attention.
Export in the format you need
Use the export options to copy the parsed variables in the format most useful for your workflow. JSON export produces a JSON object (key: value pairs) suitable for use as test fixture data, API mock responses, or environment configuration in a Node.js test setup. Shell export produces a series of export KEY=value lines that you can source in your terminal with: source output.sh.
Features
Parses all standard .env formats: unquoted, single-quoted, double-quoted values
Strips # comments and blank lines automatically
Duplicate key detection highlighted in red
Empty value warning highlighted in amber
Export as JSON object or shell export commands
Shows total variable count, duplicate count, and empty count
Zero server upload — parsing runs entirely in your browser
No account or installation required
Related Tools
Frequently Asked Questions
What .env file format is supported?
This parser handles the most common dotenv formats: KEY=value (no quotes), KEY=value with spaces (which requires quotes), KEY=single quoted value, KEY=double quoted value, and inline comments after the value separated by whitespace and a hash. Lines beginning with # are treated as comments and skipped. Blank lines are ignored. Export-prefixed lines (export KEY=value) are also supported.
Is it safe to paste my .env file with real secrets?
The parsing happens entirely in your browser — no data is sent to any server. However, as a general security practice, avoid pasting production secrets containing API keys, database passwords, or private tokens into any online tool. Instead, use a sanitized .env with placeholder values, or use this tool only for development and staging environment files.
Why do I have duplicate keys in my .env file?
Duplicate keys usually appear when multiple developers edit the same .env file without coordination, when a file is merged from multiple sources, or when a key is renamed but the old version is not removed. Most dotenv libraries use the first occurrence and silently ignore subsequent duplicates, which can cause confusing behaviour when the intended value is in the second occurrence.
How do I use the JSON export?
The JSON export produces a JavaScript object literal (an object with key-value string pairs). You can paste this into a test fixture file, use it as the body of a mock fetch response, or import it in a Node.js setup file with const env = require(./fixtures/env.json). It is also useful for quickly visualising the full set of variables in a readable format.
What is the difference between .env and .env.local?
.env is the base environment file committed to source control and shared across all environments. .env.local (and .env.development.local, .env.production.local) are machine-specific overrides that are gitignored and take precedence over the base .env. Most frameworks like Next.js, Vite, and Create React App follow this convention. Use .env for shared defaults and .env.local for personal or machine-specific secrets.