Home/Guides/Fix .env file syntax

Fix .env file syntax

.env files use KEY=VALUE format. Invalid syntax—spaces around =, unquoted values with special chars, or wrong line endings—can cause parse errors.

Common causes

  • Spaces around = in KEY = VALUE.
  • Unquoted value containing # or spaces.
  • Windows line endings (CRLF) in some parsers.

How to fix

  • Use KEY=VALUE with no spaces, or quote values containing spaces.
  • Quote values with #, =, or spaces.
  • Validate with Env File Validator.

Use our tool

Validate .env
All guides