Boneyard Tools

Env File Validator and Linter

Paste your .env file to lint it for common mistakes. The validator flags lines with no assignment, invalid key names, duplicate keys, stray spaces around the equals sign, and unquoted values that contain spaces, each with its line number.

How to validate a .env file

  1. Paste the contents of your .env file into the box.
  2. Read the list of issues, each tagged as an error or a warning with its line number.
  3. Fix the flagged lines until the file reports as valid.

Examples

A clean file

API_KEY=abc123
DEBUG=true
valid: true, 2 keys, no issues

A duplicate key

TOKEN=a
TOKEN=b
warning on line 2: duplicate key TOKEN

Frequently asked questions

What counts as a valid key name in a .env file?

A key must start with a letter or underscore and then contain only letters, digits and underscores, matching [A-Za-z_][A-Za-z0-9_]*. Names with hyphens, dots or spaces are flagged as errors because most dotenv loaders will not read them.

What is the difference between an error and a warning here?

Errors are problems that usually break parsing, such as a line with no equals sign or an invalid key name, and they make the file report as not valid. Warnings are likely mistakes, such as duplicate keys or stray spaces, that many loaders tolerate but you probably did not intend.

Why does it warn about spaces around the equals sign?

Most dotenv parsers treat KEY=value literally, so KEY = value can store a key with a trailing space or a value with a leading space. The validator warns so you can remove the spaces and avoid surprises.

Why flag unquoted values that contain spaces?

An unquoted value with spaces can be truncated or split by some loaders. Wrapping it in single or double quotes, like NAME="John Doe", keeps the whole value intact, so the tool suggests quoting it.

Is my .env file uploaded anywhere?

No. The file is parsed entirely in your browser, so its secrets never leave your device and nothing is sent to a server.

Related tools