Skip to content

Dotenv Parser & Validator

Developer Tools•Client-Side & Private

Parse and validate .env files with dotenv’s exact grammar — duplicates, bad names and unclosed quotes flagged, values masked, diff against .env.example.

Tool workspace

Values are masked by default and nothing is uploaded — paste a real .env only if you are comfortable; the parsed values never leave this browser.

11 keys · 2 errors · 2 warnings
Issues

Line 6 · warning: Empty value for key “EMPTY_VALUE”.

Line 7 · error: Invalid key name “1BAD-NAME” — dotenv keys must start with a letter or underscore and contain only letters, digits and underscores.

Line 8 · warning: Duplicate key “API_KEY” — first defined on line 4; the later value wins at runtime.

Line 13 · error: Unclosed double quote for key “UNCLOSED”.

Diff vs .env.example

Missing in .env: SECRET_KEY

In .env but not in .env.example: EMPTY_VALUE, 1BAD-NAME, MULTILINE, SINGLE, UNCLOSED

Parsed keys
KeyValueLineNotes
APP_NAME••••••2export · double-quoted
DATABASE_URL••••••••••••3unquoted
API_KEY••••••••••••4unquoted
DEBUG••••5unquoted
EMPTY_VALUE(empty)6unquoted
1BAD-NAME••••7unquoted
API_KEY••••••••••••8unquoted
GREETING••••••••••••9double-quoted · expanded ${VAR}
MULTILINE••••••••••••10double-quoted
SINGLE••••••••••••12single-quoted
UNCLOSED••••••••••••13double-quoted
{
  "APP_NAME": "My App",
  "DATABASE_URL": "postgres://user:pass@localhost:5432/mydb",
  "API_KEY": "sk-test-67890",
  "DEBUG": "true",
  "EMPTY_VALUE": "",
  "1BAD-NAME": "oops",
  "GREETING": "Hello My App",
  "MULTILINE": "line one\nline two",
  "SINGLE": "literal $NOT_EXPANDED",
  "UNCLOSED": "never closed"
}

${VAR} expansion uses only keys defined earlier in the same file — unlike a shell, it cannot see your system environment. Copying the JSON/YAML output copies the real values: keep it out of shared chats.

Loading tool controls…

Files processed locally — never uploaded to our servers
Free Instant Private

Verify it yourself: press F12, open the Network tab, and use this tool — your files are never uploaded.

Dotenv Parser & Validator at a glance

Price
Free
Account
Not required
File uploads
None — your files are never uploaded

Who uses Developer Tools?

Developers and engineers formatting JSON, testing regex, hashing data, encoding values or building API requests.

How to Use Dotenv Parser & Validator

Follow these simple steps to get instant results in your browser.

1

Paste Your .env

Paste the .env file on the left — the sample already contains a duplicate, a bad name, an unclosed quote and an empty value to find.

2

Paste .env.example (Optional)

Paste your .env.example on the right to diff it against your .env, or turn the diff off.

3

Read the Issues and Export

Fix the flagged lines, reveal values only if you need to, then copy the parsed result as JSON, YAML or Docker Compose.

💡

What is Dotenv Parser & Validator & How Does It Work?

Dotenv Parser & Validator parses .env files with dotenv's exact grammar and flags what is wrong with them. It understands the optional export prefix, single quotes (literal — no escapes, no expansion), double quotes (escape sequences and ${VAR} expansion), unquoted values (inline comments after a space and #), and multiline double-quoted values. ${VAR} expansion uses only keys defined earlier in the same file — unlike a shell, it cannot see your system environment.

The validator flags duplicate keys (the later value wins at runtime), invalid key names (keys must start with a letter or underscore and contain only letters, digits and underscores), unclosed quotes, empty values, and ${VAR} references to keys that are not defined earlier in the file. Every issue is listed with its line number and severity.

Paste a .env.example next to your .env and the diff lists keys missing from .env, keys in .env but not in the example, and keys that are present but empty — the check that catches a missing SECRET_KEY before deploying. Values are masked by default and nothing is uploaded; the JSON, YAML and Docker Compose exports copy the real values, so keep them out of shared chats.

⚡

Key Features & Capabilities

✓

dotenv's Exact Grammar

export prefix, quotes, multiline values and ${VAR} expansion, as dotenv defines them.

✓

Line-Numbered Issues

Duplicates, invalid names, unclosed quotes and empty values, each with its line.

✓

.env.example Diff

Missing, extra and empty keys, listed against your example file.

✓

Values Masked by Default

Secrets stay hidden unless you choose to reveal them.

✓

JSON, YAML and Compose Export

Copy the parsed values in the format your next step needs.

Pro Tips

  • •Bookmark this tool for instant one-click access anytime.
  • •Drag and drop files directly onto the input surface for fastest handling.
  • •All processing happens in your browser session for maximum speed and data safety.

🎯 Common Use Cases

Catching a Missing KeyDiff .env against .env.example before deploying and find the key you forgot to set.
Debugging a Broken ConfigFind the unclosed quote or bad key name that makes your app fail to start.
Converting FormatsTurn a .env file into JSON for a script, YAML for a config, or a Docker Compose environment block.
Onboarding a New DeveloperHand a new developer the .env.example and let them diff their .env against it before their first run, so a missing key is found before the app fails to start.
📚

Sources & Further Reading

Frequently Asked Questions about Dotenv Parser & Validator

Frequently asked questions

dotenv’s exact grammar: an optional export prefix, single quotes (literal, no expansion), double quotes (escape sequences and ${VAR} expansion), unquoted values (inline comments after a space and #), and multiline double-quoted values. ${VAR} expansion uses only keys defined earlier in the same file.

Duplicate keys (the later value wins at runtime), invalid key names (keys must start with a letter or underscore), unclosed quotes, empty values, and ${VAR} references to keys that are not defined earlier in the file. Errors and warnings are listed with line numbers.

Paste your .env.example next to your .env and the page lists keys missing from .env, keys in .env but not in the example, and keys that are present but empty. It is how you catch a missing SECRET_KEY before deploying.

Values are masked by default and nothing is uploaded — parsing runs entirely in your browser. Even so, only paste a real .env if you are comfortable: the JSON, YAML and Docker Compose exports copy the real values, so keep them out of shared chats.

The sample has 11 keys, 2 errors and 2 warnings: an empty value (EMPTY_VALUE, line 6), an invalid key name (1BAD-NAME, line 7), a duplicate key (API_KEY, line 8) and an unclosed double quote (UNCLOSED, line 13).

In double quotes it expands using keys defined earlier in the same file: GREETING="Hello ${APP_NAME}" becomes "Hello My App". In single quotes it stays literal — SINGLE='literal $NOT_EXPANDED' keeps the dollar sign as-is. A ${VAR} with no earlier definition expands to an empty string and is flagged as a warning.

Complementary utilities for your workflow

View all →
You are here

Dotenv Parser & Validator

Parse, validate and diff .env files — values masked.

Current tool
Popular

JSON Formatter

Format, beautify, and syntax-highlight JSON data.

Try tool

Hash Identifier

Identify a hash — ranked candidates + Hashcat modes.

Try tool