ENV File Parser / Validator

Validate .env syntax and inspect key/value pairs.

Open tool

Overview

Paste an .env file and the validator parses each line, reports any syntax errors, and lists the parsed key/value pairs in a clean table. Useful for confirming what your dotenv loader will actually see when the app boots, especially when you've copy-pasted from a chat or shell history.

It's for developers configuring local dev environments, CI secrets, and 12-factor apps. Reach for it when an app silently picks up a wrong value, when prepping a Vercel/Netlify environment import, or when a .env.example keeps drifting out of sync with the real .env.

How it works

The parser follows the most common dotenv grammar: KEY=value per line, with optional single or double quotes around the value, # comments at line start (and warned about elsewhere), and blank lines ignored. Keys must be valid shell identifiers ([A-Za-z_][A-Za-z0-9_]*).

For each line the validator reports: a clean key/value table on success, or a precise line/column for any syntax error. It's intentionally strict so you can catch ambiguous lines that some loaders accept and others reject.

Examples

  • Clean file:
    DATABASE_URL=postgres://localhost/app
    PORT=3000
    DEBUG=true
    
  • Quoted value with spaces:
    WELCOME_MSG="Hello, world"
    
  • Multi-line via escaped newlines:
    PRIVATE_KEY="-----BEGIN KEY-----\nMIIEvA...\n-----END KEY-----"
    
  • Invalid (no =):
    DEBUG true   # error line 1: expected '=' after key
    

FAQ

Are values type-coerced?

No - all values are strings. Type conversion is the consuming application's responsibility (Number(process.env.PORT)).

Can I reference one variable from another?

Variable substitution (HOST=${DOMAIN}.com) is supported by some loaders (dotenv-expand, Vite) but not all. The validator parses literals as-is and treats ${...} as part of the string.

Does it expand export?

export KEY=value is accepted for Bash compatibility - the export token is stripped during parsing.

What about Windows-style set KEY=val?

Not supported. Keep your .env files in POSIX KEY=value form for portability across dotenv loaders.

Try ENV File Parser / Validator

An unhandled error has occurred. Reload ×