Fix up a messy .env file

Lint a dotenv file — flag duplicate keys, bad quoting, and invalid lines, with every value masked in the report.

Tools used in this guide

The job

.env files accrete: duplicated keys, inconsistent quoting, commented experiments, and stray spaces. Before committing or sharing, the file needs a pass — and the secrets must never leave the machine.

Paste and lint

Paste the file contents and run the linter. The report lists each key with its line number and the value's length — never the value itself — plus one line per issue it flags: duplicates, missing "=", unbalanced quotes, unquoted spaces, export prefixes, and more. Fix the file in your editor using the report as the checklist.

  • Nothing is uploaded — the file stays in the textarea and in memory.
  • The report shows key names and value lengths only, so a screenshot of it is safe to share in tickets.

Worked example

An input with DATABASE_URL defined twice and a line missing "=" flags both: the duplicate reports the earlier line number (most loaders let the last definition win) and the malformed line is marked as having no separator.

Where it stops

It parses and flags dotenv syntax (KEY=value, quotes, comments) — it does not rewrite the file, validate that values work, expand variables, or encrypt anything. Input is capped at 1,000,000 characters and 20,000 lines.