Omnikit
DevFilesMoneyAll tools
Ctrl K
Dev toolsFile toolsMoney calculatorsAll tools
HomeDeveloper tools.env File Validator
EnglishالعربيةবাংলাDeutschEspañolFrançaisPolskiPortuguêsРусский

.env File Validator

dev

Check a .env file line by line as dotenv reads it, and convert it to JSON or YAML

Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 16 Oct 2026.

A .env file holds one KEY=value per line, read by the dotenv package and similar tools. A # starts a comment, even inside an unquoted value, so PASSWORD=abc#123 is read as abc. Quotes keep spaces and # signs, double quotes turn \n into a line break, and when a key appears twice the last value wins.

Next:
  • Dockerfile Linter Check a Dockerfile against 55 hadolint rules: pinned versions, root user, cache and more
  • YAML to JSON Convert YAML to JSON and JSON to YAML, with anchors resolved

How to check a .env file for mistakes

1

Paste the .env file into the left pane, or click Open a file.

2

Read the problems under it: each names its line, and Line N puts the cursor there.

3

Pick a format, JSON, YAML, Shell export, Docker env file or .env.example, to see the variables converted.

4

Click Copy, or Download to save the converted file.

About .env File Validator

A .env file looks simple, but small slips change what the program receives without any error: a # inside a password cuts it short, an unclosed quote becomes part of the value, and a second line with the same key quietly replaces the first. This tool reads the file exactly as the dotenv package does and shows every such line.

What is checked, with the line number of each:

Problem Example What happens
Not an assignment just some text ignored
# in an unquoted value PASS=abc#123 read as abc
Unclosed quote NAME="Asha value keeps the quote
Duplicate key PORT twice the last one wins
Name a shell rejects feature.flags=on source .env fails
Undefined reference ${REDIS_HOST} left as written
Spaces without quotes FROM=Example Team breaks in a shell

Errors are lines dotenv ignores or misreads; warnings work in dotenv but not in a shell, Docker or Compose; notes such as an empty value are for information.

Conversions. The variables, as dotenv reads them, can be copied or downloaded in 5 forms: a JSON object; YAML, with every value kept as a string so 0123 and true are not reinterpreted; shell export lines with safe single quotes; a Docker env file, which cannot carry multi-line values; and a .env.example with every key and no values, ready to commit.

The reading is checked against dotenv itself on 401 test files, including multi-line keys, CRLF line endings and every quoting style. Nothing is expanded: ${OTHER} stays as written, as with plain dotenv.

The file stays in your browser's memory only. It is never uploaded, never stored, and is gone when you close the page, so real secrets are safe to paste.

Frequently asked questions

Why is my .env variable cut off at a # sign?

In a .env file, a # starts a comment, even in the middle of an unquoted value, so PASSWORD=abc#123 is read as abc. Put the value in quotes, PASSWORD="abc#123" or PASSWORD='abc#123', and the whole text is kept. Every line with this problem is flagged here with its line number.

Can a .env value contain spaces?

Yes. dotenv trims spaces at both ends but keeps the ones inside, so NAME=Example Team works. A shell running source .env would break on the space, though, and Docker keeps everything literally. Quoting values that contain spaces, NAME="Example Team", works the same in dotenv, Compose and shells.

How do I write a multi-line value in a .env file?

Wrap the value in double quotes and either break the lines for real or write \n where each break goes. dotenv reads both, and turns \n into a line break only inside double quotes. Single quotes and backticks also span lines but keep \n as written. A Docker env file cannot hold multi-line values at all.

What happens when a key appears twice in a .env file?

The last value wins, with no warning from dotenv, so a PORT set near the top can be silently replaced by another PORT further down. This tool lists every duplicate with the line of the first definition, so you can delete the one that should not be there.

Are ${VARIABLES} expanded in a .env file?

Not by dotenv itself: API=${HOST}/api stays exactly as written. Docker Compose and the dotenv-expand package do replace ${HOST} with its value, and ${HOST:-fallback} supplies a default when HOST is unset. References to names the file never defines are flagged here, because they become empty in those tools.

Is it safe to paste a .env file with real secrets here?

Yes. The file is read by code running in your own browser; nothing is uploaded, logged or stored, and it is gone when you close or reload the page. Unlike the output format, which is remembered, the text you paste is never saved, not even in your browser's storage.

Sources

  • dotenv README, What rules does the parsing engine follow? (motdotla/dotenv)Comments, quotes, multi-line values, \n expansion and duplicates
  • POSIX.1-2024 Base Definitions, 3.216 Name (The Open Group)Which variable names a shell accepts
  • Docker Docs, docker container run, --env-fileDocker env files are read line by line, literally
  • Docker Docs, Interpolation in Compose${VAR} and ${VAR:-default} references

Last verified 16 October 2026.

Rates and rules change; check the source before you rely on a figure.

Still stuck? Ask about .env File Validator and anybody who knows can answer. No account needed.

Common uses

  • .env to JSON ConverterConvert a .env file to a JSON object, with quotes, comments and multi-line values handled

Same job, other tools: Link Preview Checker – Find the missing tag behind a WhatsApp or Slack link with no picture · Twitter Card Validator – Check twitter:card tags and the og: tags X falls back to.

On the related tools: Readability Checker – Flesch reading ease and grade level, with what to change.

Open it set for: .env.example Generator.

Related tools

All developer tools
Regex TesterTest JavaScript regular expressions with live highlighting and a plain-English explanationDiff CheckerCompare two texts side by side and see every added and removed lineJSON DiffCompare two JSON documents and list every added, removed and changed valueOpen Graph PreviewPaste a page and see the share card for Facebook, LinkedIn, X, WhatsApp and SlackKeyword Density and ReadabilityWord and phrase counts, densities, reading time and a Flesch readability scoreHTTP Status CodesEvery HTTP status code, what it means, when to send it and the RFC it comes fromUser-Agent ParserRead a user-agent string: browser, engine, OS, device type and whether it is a botJSONPath TesterRun RFC 9535 JSONPath queries on pasted JSON and see every match highlighted
Was this tool helpful?
Omnikit

Small jobs, done in your browser. Free, fast and private. Files are never uploaded.

Files

  • Compress Image
  • Image to PDF
  • Merge PDF
  • Compress PDF
  • PDF to Word
  • Word to PDF

Dev

  • JSON Formatter & Validator
  • Base64 Encode & Decode
  • JWT Decoder, Verifier & Encoder
  • Password Generator
  • UUID Generator
  • Unix Timestamp Converter

Money

  • SIP Calculator
  • EMI Calculator
  • GST Calculator
  • FD Calculator
  • PPF Calculator
  • Lumpsum Calculator
EnglishالعربيةবাংলাDeutschEspañolFrançaisPolskiPortuguêsРусский
GuidesQuestionsAboutHow we checkLaw library (beta)PrivacyTermsDisclosureContactMore: Exam practice (UGC NET Paper 1)Runs in your browser. Nothing is uploaded. © 2026 Omnikit (theomnikit.com)