.env Toolkit

Validate, compare and convert .env files (to JSON/YAML/shell).

The .env Toolkit checks, compares and converts dotenv files. Validate mode lists problems such as duplicate keys, empty values and malformed lines, Compare mode shows which keys differ between two files, and Convert mode turns a .env file into JSON, YAML or shell export commands.

What is a .env file?

A .env (dotenv) file stores configuration as KEY=VALUE lines, one per line, so an application can read settings such as database hosts and API keys from its environment instead of from code. Lines starting with # are comments, values can be wrapped in single or double quotes, and many loaders also accept a leading export keyword. There is no formal standard, so parsers differ slightly: quoting rules, multi-line values and inline comments vary between libraries. When the same key appears twice, the common dotenv behaviour is that the last occurrence wins. Because .env files often contain secrets, they should be kept out of version control and each environment, such as development and production, should have its own copy. A .env.example with the key names but no real values is a common way to document what is required.

How to use .env Toolkit

  1. Choose a mode Use the Mode control to select Validate, Compare or Convert.
  2. Paste your file Paste the contents into the .env file box. In Compare mode there are two boxes, File A (.env) and File B (.env).
  3. Pick an output format (Convert only) Under Output format choose JSON, YAML or Shell exports. The Converted box updates immediately.
  4. Read the result Validate shows a table of Line, Level and Message or a success message. Compare shows a Status and Keys table. Copy or download converted output from its box.

Frequently asked questions

What does a warning for an empty value mean?

A key such as EMPTY= is defined with no value. That can be intentional, but it is often a placeholder someone forgot to fill in, so the tool reports it as a warning.

Which key names are accepted without a warning?

Keys that start with a letter or underscore and continue with letters, digits, underscores or dots. Other characters produce a warning about unusual characters.

Which value wins when a key is repeated?

The last occurrence. Convert and Compare both use the last value for a repeated key, matching common dotenv behaviour. Validate reports the duplicate.

How are escapes handled in quotes?

In double quotes, \n becomes a newline, \" becomes a quote and \\ becomes a backslash. Single-quoted values are taken literally.

Does the tool understand variable expansion like ${OTHER}?

No. Values are read as written and no variable substitution is performed.

Are my values kept private?

The page states that processing happens in the browser and that values are not logged, sent or shown in diagnostics. Messages and the comparison table only contain key names. Converted output does contain the values, since that is its purpose.