Skip to content

Compare two env files

Compare two env files by pasting them side by side. Values stay masked until you choose Shown.

Values are masked by default so a screenshot does not leak secrets. Comments are ignored. Invalid lines are not repaired.

Ctrl+Enter or ⌘+Enter runs this tool immediately.

Values
Original ENV
Changed ENV
Differences

Paste both documents to compare them.

Waiting for input.

Parsing stays in this browser. Input is not uploaded or saved.

How to use this tool

  1. Paste the original file on the left and the changed file on the right, or load the sample.
  2. Read + added, - removed, and ~ changed. Values are ******** until you pick Shown.
  3. A missing = or a $ interpolation is an error. The diff stays empty.

What this conversion loses

  • Comments, blank lines, and key order. Only keys and values are compared.
  • export prefixes. Both KEY=value and export KEY=value are the same key.
  • When values are masked, the output does not show what changed, only that the key changed.

Supported formats and limitations

  • Each side is a list of KEY=value lines. Duplicate keys are errors.
  • $NAME and ${NAME} are not expanded. They are errors, as on the ENV to JSON page.
  • Every value is a string. true and 1 are not converted to other types.
  • This is not git diff. Unchanged keys are omitted.

Examples

A changed secret

SECRET is removed and TOKEN is added. APP_ENV changed. API_URL is omitted because it matches.

APP_ENV=prod
API_URL=https://example.com
TOKEN=new

Same keys, different order

A=1 then B=2 matches B=2 then A=1. There is no difference.

B=2
A=1

Common errors and solutions

Missing =
Each line that is not a comment needs KEY=value.
Variable interpolation is not expanded
Replace $NAME with the literal value. This tool does not read other keys or the host environment.

FAQ

How do I compare two env files?
Paste the original file on the left and the changed file on the right. Added, removed, and changed keys are listed.
Is this a .env diff tool online that hides secrets?
Values are masked by default so a screenshot does not leak them. Shown writes the values into the difference list in this browser only.
Does this compare .env.example to .env?
Yes. Keys only in one file are added or removed. Shared keys with different values are changed.
Are the files uploaded?
No. Both are compared in your browser. They are not sent to an application server or to analytics.

Privacy check

Open DevTools → Network, paste a document, and confirm no request carries the editor text. The page load and the Google tag still appear. Analytics events carry the tool name, never what you pasted.

Read next

Related tools

  • ENV validator

    Check a .env file without converting it. Duplicate keys, missing equals signs, and $ references are errors, and the editor text is not rewritten.

  • ENV to JSON converter

    An env to JSON converter that runs in the browser. Every value stays a string, duplicate keys are errors, and $ references are not expanded.

  • JSON and YAML diff

    Compare two JSON or YAML documents by value in the browser. Key order, formatting, and comments are ignored, and Kubernetes lists are matched by name.