.env file editor and validator

Paste a .env file to find duplicate keys and syntax mistakes, tidy it up, create a .env.example with the secrets removed, or convert it to JSON, YAML, shell exports or Docker flags.

How to use the .env file editor

  1. Paste your .env file or click Open File.
  2. Read the list of problems, such as duplicate keys, spaces around = or values that need quotes.
  3. Pick an output, for example .env.example, then click Copy or Download.

.env syntax in one minute

# A comment
APP_NAME=inventory            # plain value
APP_URL="https://example.com" # quotes are optional here
GREETING="Hello World"        # quotes are needed for spaces
PRIVATE_KEY="line one\nline two"
EMPTY=
  • One NAME=value pair per line, with no spaces around the equals sign.
  • Names use capital letters, digits and underscores, and do not start with a digit.
  • Put double quotes around values with spaces, # or special characters.
  • Lines starting with # are comments.

What the checker looks for

ProblemWhy it matters
Duplicate keysOnly one value is used, usually the last, and it may not be the one you expect
Spaces around =Docker and shells treat the space as part of the name or value
Unquoted spaces or #The value may be cut short
Quotes that do not closeThe rest of the file can be swallowed into one value
Lowercase or invalid namesSome tools reject them
Empty valuesOften a setting someone forgot to fill in

Why you need a .env.example

A real .env holds passwords and API keys, so it must never be committed to Git. An .env.example lists the same variable names with the values removed. Commit that file instead, so teammates know what to fill in. Add .env to your .gitignore, which the .gitignore generator does for you.

In the example file, values that are clearly not secret, such as ports, true and false, and localhost addresses, are kept as helpful defaults. Everything else is blanked.

Using the variables in containers? The YAML output drops straight into a Compose file from the Docker Compose generator.

Private by design

This tool runs entirely in your web browser. Nothing you type or paste is sent to a server, logged or stored, so it is safe to use with internal addresses, configuration files and other work data. There is no sign-up and it keeps working offline once the page has loaded.

Frequently asked questions

Is it safe to paste my .env file here?

The file is processed in your browser and is not uploaded, stored or logged. It is still good practice to rotate any secret you think may have been exposed elsewhere.

How do I create a .env.example file?

Paste your .env, keep the output set to .env.example and click Download. Secrets are removed and the names and comments are kept.

Do .env values need quotes?

Only when they contain spaces, a # character or other special characters. Quoting everything is also fine.

Can I convert .env to JSON or YAML?

Yes. Choose JSON or YAML as the output.

Why is my variable empty in Docker?

Common causes are spaces around the equals sign, quotes that Docker keeps as part of the value, or the same key defined twice.