.env Tools

Check and clean .env files, create value-free examples and compare configuration keys.

On your device. Your input is not uploaded or saved.

Create one empty KEY= entry per unique key. All values and comments are removed from the output.

Supported .env syntax

Keys are case-sensitive and use letters, digits and underscores; the first character must be a letter or underscore. Optional export prefixes, empty values, single/double quotes and quoted multiline values are supported. Outside quotes, # begins a comment.

Backslash-escaped quotes are kept inside quoted values. Escape sequences, variable references and commands are kept as text; nothing is expanded or executed. Backtick quoting and shell scripts are not supported. Parser conventions vary by framework.

Cleanup uses LF line endings, preserves quoted value content and keeps duplicate assignments. Example generation removes duplicates and comments as well as values. Key comparison ignores order and duplicates.

Up to 100,000 characters and 5,000 lines per file. Inputs stay in this page’s memory; they are not uploaded or saved.

How to create a .env.example file

  1. Choose an action: Create .env.example, Clean up or Compare keys.
  2. Paste your .env file, or press Load example to see how it works. Invalid lines are listed with their line numbers.
  3. To compare two files, paste one into File A and the other into File B to see which keys each one is missing.
  4. Turn on Sort keys A–Z if you want the output in alphabetical order.
  5. Copy the result, or press Download to save it as .env.example or .env.cleaned.

Validate a .env file

Each line must be KEY=value, a comment starting with # or a blank line. Keys are case-sensitive, use letters, digits and underscores, and cannot start with a digit. An optional export prefix, empty values, single and double quotes and quoted values that span several lines are accepted.

Lines that do not parse, unclosed quotes and backtick quoting are reported as errors, and repeated keys as warnings, each with its line number. Escape sequences, ${VAR} references and command substitutions are kept as plain text: nothing is expanded or executed. dotenv libraries treat these differently, so check your framework if a value relies on them.

Share configuration without secrets

Create .env.example writes one empty KEY= entry per unique key. Values, comments and export prefixes are never copied, so the file is ready to commit and shows teammates which variables they need to set.

Compare keys lists the keys found only in File A, only in File B and in both, for example to find what a production .env is missing compared with .env.example. Values are not compared or displayed. Clean up normalizes spacing around = and uses LF line endings, while keeping values, quotes, export prefixes, comments and duplicate keys as they are.

Limits

Each file can have up to 100,000 characters and 5,000 lines. Sorting moves comments together with their key, but if your loader expands references to earlier variables, a new order can change the loaded values.

Where does my data go?

The tool processes your .env file in this page's memory. It never uploads or saves the file, its keys or its values.

Like the rest of the site, this page uses Google Analytics and Yandex Metrica, including Metrica session replay. Tool events report only that the tool was opened or used.

The tool area is marked so that Metrica masks what you type and the results in its session recordings.

Also useful

No third-party trackers on JZR Tools. We count anonymous visits with country, referring site and device type only.