⭐ 0

ENV Validator

Check a .env file for KEY=VALUE rows, duplicate keys, and quotes that open and do not close.

🔒 Processed entirely in your browser — nothing you enter here is ever uploaded.

The result appears on this page after you run the tool. Nothing you enter is uploaded.

Processing... 0%
Parsing env variables
Verifying keys format
Checking values quotes
Checking duplicates
Compiling configuration

Result

About this tool

Paste the file. Each line is trimmed. An empty line is skipped, and a line whose first character is # is skipped as a comment. Every other line must contain an equals sign. The key is the text before the first equals, trimmed, and the value is everything after it, trimmed. A line with no equals fails as Invalid ENV row and quotes the line. The key has to match a letter or underscore, then zero or more letters, digits, or underscores. The pattern is case-insensitive, so both DATABASE_URL and database_url are accepted shapes. A key that starts with a digit, or that contains a hyphen or a space, fails with Invalid environment variable key name and the line number.

The word export is not special. A line written as export FOO=bar has a key of export FOO, the space fails the pattern, and the row is rejected. Write FOO=bar. Quotes are checked only at the ends of the trimmed value. A value that starts with a double quote must end with a double quote, and the same rule applies to a single quote. Otherwise the line fails as unclosed double quotes or unclosed single quotes. The scanner does not interpret escape sequences, does not expand ${OTHER}, and does not join a backslash-continued line. The value is not required to be quoted at all.

Keys are remembered for the whole paste. A second FOO= fails with Duplicate environment key and the line number of the repeat. The first occurrence is not restated. Blank lines and comments do not count as keys. A file that survives every line ends with the sentence .env configuration syntax is valid! There is no list of the keys that passed. The check does not load the variables into the page and does not compare them with a sample schema. This is a shape check, not a dotenv implementation. It will not tell you that a URL is malformed, that a port is missing, or that a quoted value contains the quote character you meant to escape. It will tell you about a missing equals sign, a key the pattern rejects, a duplicate name, and a quote that does not close. Line numbers are 1-based and count every physical line, including comments. The paste stays in the browser. A value may contain spaces after the equals sign once it has been trimmed at the ends, and an unquoted hash in the middle of a value is kept as part of that value rather than starting a comment.

Example. FOO=bar and BAR=baz pass with .env configuration syntax is valid! A second FOO=bar fails with Duplicate environment key: "FOO". export FOO=bar fails because the key is read as export FOO.

Limit. The scan does not strip export, does not expand variables, and does not join continued lines. A quote is only checked as a matching pair at the two ends of the value.

Does export FOO=bar pass?

No. The key is everything before the first equals, so the key is export FOO. The space is not a letter, digit, or underscore, and the row fails with Invalid environment variable key name. Write FOO=bar.

Are lowercase keys allowed?

Yes. The pattern is case-insensitive. database_url matches. A key must still start with a letter or an underscore, and the rest may be letters, digits, and underscores. A hyphen fails.

What does a passing file report?

One sentence: .env configuration syntax is valid! The page does not echo the keys. A duplicate names the key and the line. An unclosed quote names double or single quotes and the line.

Are comments and blank lines errors?

No. A blank line is skipped, and a line that starts with # after trimming is skipped. A comment in the middle of a value is not recognized. The # has to be the first character of the trimmed line.