Cleaned file
0 lines
Results Waiting

Paste a .env file or open one. Each line is checked as you type.

Copy or download the cleaned file
0 variables 0 errors 0 warnings 0 tips 0 comments

Runs entirely in your browser. Your file and its secrets are never uploaded.

This ENV file validator checks a .env file line by line and tells you exactly what will break, what might break, and what’s just untidy. It reads the file the way dotenv does, then flags anything Docker, Docker Compose or a shell would read differently. Click any issue to jump straight to that line, see the final value of every variable, and download a cleaned copy with the bad lines removed.

How to check a .env file

  1. Paste your file into the left box, open it with Open file, or drag it onto the box. Files like .env.local and .env.production work too.
  2. Results show up as you type. The badge at the top tells you if the file is valid, and line numbers turn red or amber where there’s a problem.
  3. Click an issue in the Issues tab to highlight that line in your file.
  4. Open Variables to see the value each key actually loads as, including multi-line values and anything cut off by a #.
  5. Open Cleaned to copy or download a fixed file. Turn on Hide values first if you’re sharing your screen.

What the validator checks

CheckExampleLevel
Line has no =REDIS_URLError
Name starts with a number or has spaces or symbols2FA_KEY=xError
Invisible characters pasted into a nameAPI_KEY=xError
Quote opened but never closedMSG="HelloError
Duplicate keys with different valuesAPP_ENV set twiceWarning
Unquoted # that cuts the value shortPASS=abc#123Warning
Spaces around =PORT = 3000Warning
Dots or dashes in a nameapi-key=xWarning
Text after a closing quote, curly quotes, KEY: value syntaxA="x" yWarning
References to variables that aren’t defined${DB_USER}Tip
Unquoted spaces, inline comments, empty values, lowercase namesNAME=My AppTip
Multi-line values, Windows line endings, byte-order markKEY="line 1…Tip

Errors are lines that won’t load at all, or will load as something you didn’t mean. Warnings usually point to a real bug, like a password that’s silently cut short. Tips are things that work in dotenv but can trip you up somewhere else.

Why the same .env file works in one place and not another

There’s no official .env standard. Each tool parses the file a little differently, which is why a file that works locally can fail in a container or a deploy script.

Linedotenv (Node, Python)Docker --env-fileShell source
PORT = 30003000Rejected (space in name)Runs a command, fails
PASS=abc#123abcabc#123abc#123
T=30 # sec3030 # sec30
NAME=My AppMy AppMy AppRuns App, fails
KEY="a"a"a" with the quotesa
api-key=xWorksWorksError

The validator treats dotenv as the baseline, since it’s what most apps use, and warns you wherever the other two disagree. If your file only needs to work with dotenv, you can safely ignore most tips.

What the cleaned file changes

  • Removes lines with errors and keeps only the last copy of any duplicate key, which is the one dotenv and Docker would use anyway.
  • Rewrites KEY = value and KEY: value as KEY=value, and strips indentation, trailing spaces, Windows line endings and the byte-order mark.
  • With Quote risky values on, wraps values that contain spaces or a # in quotes so every tool reads them the same way.
  • Keeps your comments and section spacing unless you turn off Keep comments or sort the keys A–Z.

It never changes the values themselves, and quoted values (including multi-line keys and certificates) are copied exactly as written.

Is it safe to paste secrets here?

Yes. Everything runs in your browser with JavaScript. Nothing is uploaded, logged or stored on a server, and the tool works with your network disconnected once the page has loaded. Your options (like Hide values) are saved in your browser, but your file content isn’t. For extra caution with production secrets, turn on Hide values or swap real secrets for placeholders before pasting.

Frequently asked questions

Do values in a .env file need quotes?

Not usually. KEY=value is fine for simple values. Use quotes when a value has spaces, a #, or spans multiple lines. Double quotes let you use \n for a new line and ${VAR} references. Single quotes keep everything literal, which is the safest choice for passwords containing $.

Which value wins if a key appears twice?

In dotenv and Docker, the last one in the file wins. The validator marks the earlier copies so you can delete them, and the cleaned file keeps only the last one.

Why is my password cut off at the # sign?

dotenv treats an unquoted # as the start of a comment, so PASS=abc#123 loads as abc. Wrap it in quotes, like PASS="abc#123", and the full value loads.

Can variable names have dashes or dots?

dotenv will accept them, but shells, Docker Compose substitution and many frameworks won’t. Stick to letters, numbers and underscores, and don’t start with a number.

How do I add a multi-line value like a private key?

Wrap the whole value in double quotes and keep the line breaks, or put it on one line with \n where each break goes. Both work in dotenv. Docker’s --env-file doesn’t support multi-line values, so use the \n version if you need it there.

Is export KEY=value allowed?

Yes. dotenv ignores the export prefix, and it lets you source the same file in a shell. The validator accepts it and keeps it in the cleaned file.

Does it check that my values are correct?

It checks the format, not the meaning. It can’t tell if a database URL or API key actually works, but it will catch the syntax problems that stop those values from loading the way you expect.

Our Full Dev Tool Library

Flipper File