.env Toolkit

Compare two .env files without exposing values, convert .env to JSON or JSON to .env, or produce a .env.example with secrets stripped. Everything runs locally.

Use the tool

Why this tool exists

Environment files drift. Staging has a variable production lacks, a teammate adds a key and forgets to tell anyone, or you need an example file for the repository without copying real passwords into it. Comparing files by eye risks reading secrets aloud in a screen share.

This toolkit has four modes. The diff lists keys only in A, only in B, identical and different, with values masked unless you ask to see them. The converters turn .env into JSON and nested JSON back into upper-case names with underscores. The example generator keeps keys and comments, blanks secret-looking values and optionally keeps harmless ones. It runs in the browser.

How to use it

  1. Pick a mode: diff A vs B, .env to JSON, JSON to .env or generate .env.example.
  2. Paste the first file into the first box, and the second file into the second box for diff mode.
  3. Choose whether to show values in the diff or keep safe values in the example.
  4. Run the tool and copy the result.

Frequently asked questions

Are values shown in the diff?

Not by default. Differences are reported with value lengths only, so secrets are not exposed. Tick the show values option if you need the actual values.

How does JSON to .env handle nested objects?

Nested keys are joined with underscores and upper-cased, so db.host becomes DB_HOST. The top level must be an object, and null becomes an empty value.

How does it decide what is secret in the example file?

Keys with names like SECRET, TOKEN, PASSWORD or API_KEY, values that match known secret formats and URLs with embedded credentials are replaced by a placeholder or left empty.

Does anything leave my browser?

No. All four modes run locally in your browser and no file is uploaded, so you can compare real environment files, although masked output is safer to share.