.env Validator

Parse and validate dotenv content: syntax, duplicate keys and empty values.

  • Runs locally in your browser
  • No upload required

Try it

Values are never displayed — only keys, lengths and quoting are reported.

Valid
no
Errors
2
Warnings
0
Variables
4
Line 3 · error
duplicate key "PORT" (first defined on line 2)
Line 4 · error
"API_KEY" has an unclosed double quote
Line 1 · NODE_ENV
10 char value
Line 2 · PORT
4 char value
Line 3 · PORT
4 char value
Line 4 · API_KEY
12 char value, quoted

Supported formats

Input
text
Output
boolean, number, text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Valid: 3 variable(s), 0 warning(s).

How it works

  • Read the file line by line, ignoring blank lines and `#` comments.
  • Split each remaining line at the first `=` into a key and a value, allowing an optional `export ` prefix.
  • Checked the key against the POSIX variable-name pattern, tracked duplicates and checked for empty or unclosed values.
  • Only the key, value length and quoting state are reported; secret values are never echoed back.
  • Dotenv expansion (`${VAR}`), multi-line values and per-language extensions are not resolved: this is a syntax check.

Methodology

  1. Ignore blank lines and comments.
  2. Split each line at the first `=`; validate the key and detect duplicate keys.
  3. Detect empty values and unclosed quotes.
  4. Report errors and warnings with line numbers and never echo secret values.

Usage

  1. Paste the contents of a .env file.
  2. Read the per-line errors and warnings.
  3. Fix duplicates, empty values and unclosed quotes before deploying.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Valid file

jsonSelect to copy
{
  "content": "NODE_ENV=production\nPORT=3000\n# comment\nAPI_KEY=\"abc\""
}

Duplicate key

jsonSelect to copy
{
  "content": "PORT=3000\nPORT=8080"
}

Unclosed quote

jsonSelect to copy
{
  "content": "API_KEY=\"unterminated"
}

Limitations

Syntax versus schema

A `.env` file is a simple `KEY=VALUE` format. This tool checks that each line parses, that keys are valid names, that no key is defined twice and that quotes are balanced. It cannot tell you whether `DATABASE_URL` is reachable or whether a required key is missing.

Because .env files usually hold secrets, the report deliberately shows only the key names, value lengths and quoting state: never the values.

Frequently asked questions

Are my secrets uploaded anywhere?
No. The check runs entirely in your browser; no value or file leaves the page and nothing is stored.
Why is an empty value only a warning?
An empty value is legal dotenv, but it is often an accident; it is reported as a warning so you can decide.

Sources

  1. The Open Group Base Specifications: Environment Variables — The Open Group
  2. dotenv: File format — dotenv