Developer

.env Validator & Converter

Paste or drop a .env file. Find the mistakes that make parsers cut, drop or misread a value, compare it with .env.example, diff two environments, and convert it to Kubernetes, Compose, JSON or shell.

  • Everything runs locally in your browser. Values are masked and never leave this page.
Your .env

Text areas hide their content while you are not typing in them. Pasted text loses its line endings, so open or drop the file itself to check for CRLF and BOM.

Validation

    Parsed variables

    How it works

    1

    Paste the file, or drop it on the box. Dropping the file keeps its line endings and BOM so they can be checked too.

    2

    Open Validate. Every finding names the line, the key, a severity and a one sentence explanation.

    3

    Use Compare to see which keys from .env.example are missing, which are extra and which are empty.

    4

    Use Diff for staging against production. Values stay masked until you tick Show values.

    5

    Use Convert to produce a Kubernetes Secret, ConfigMap, Compose block, JSON, shell exports or a cleaned-up .env.

    What the validator reports

    SeverityExamples
    errorinvalid key name, line without "=", unclosed quote, empty key, BOM
    warningspaces around "=", unquoted value with spaces or #, duplicate key, CRLF, trailing whitespace, undefined or later-defined ${VAR}, text after a closing quote, invisible characters, curly quotes
    infoexport prefix, multiline value, inline comment, empty value, overridden earlier duplicate, backtick quoting

    Parsing rules and where parsers differ

    Lines are KEY=value with an optional export prefix. A value in double quotes decodes \n, \r, \t, \" and \\; single quotes are literal apart from \'; backticks are literal. Quoted values may span lines. An unquoted value ends at a space followed by # and is trimmed.

    The parsers disagree in places. Node dotenv also cuts an unquoted value at a # with no space before it, python-dotenv and Compose do not. Backtick quoting exists only in Node dotenv. docker run --env-file does not support quotes or multiline values at all. A shell that sources the file splits unquoted values on spaces. The findings say which case you are in; quoting values with single quotes is the safest choice across all of them.

    Converting to YAML safely

    Values such as yes, no, on, off, null, 0123 or 1e3 would become booleans, null or numbers in YAML, which silently changes what Kubernetes receives. The converter writes plain scalars only for simple words and double-quotes everything else, including values with colons, a leading space or newlines. Kubernetes Secret data values are base64 of the UTF-8 bytes.

    For Compose, a literal $ must be written $$, otherwise Compose tries to interpolate it. The converter doubles it by default and tells you when it did. Values containing ${VAR} are written as they are; nothing is expanded.

    Frequently asked questions

    Frequently asked questions

    Is my .env file uploaded anywhere?

    No. The file is parsed by JavaScript running in your browser. Nothing is sent to a server, nothing is stored in localStorage or cookies, and values are never put into the page address. Values are masked on screen until you turn on Show values.

    Which parser rules does the validator follow?

    The rules of Node dotenv, python-dotenv and Docker Compose, which agree on the common cases: KEY=value lines, optional export prefix, single, double and backtick quotes, inline comments after whitespace and #, and multiline quoted values. Where they differ, for example a # inside an unquoted value, the finding says which tool behaves how.

    What happens when a key appears twice?

    The later definition wins in Node dotenv, python-dotenv and Compose, and the earlier one is ignored. The validator flags both lines. Note that a variable already set in the real process environment normally beats the file in Node and Python loaders unless override is enabled.

    Why is a value with spaces or a # a problem?

    Unquoted values are cut at a space followed by #, and Node dotenv also cuts at a # with no space. A shell that sources the file would additionally split an unquoted value with spaces into a command. Quoting the value removes the ambiguity for every parser.

    Does Kubernetes base64 handle non-ASCII text?

    Yes. Values are encoded as UTF-8 bytes first and then base64, so accented letters, emoji and multiline certificates round trip correctly. You can also choose stringData and let Kubernetes do the encoding.

    Is base64 in a Kubernetes Secret encryption?

    No. base64 is only an encoding and anyone who can read the manifest can decode it. Do not commit the generated Secret to a public repository; use sealed secrets, SOPS or an external secret manager for anything that must live in git.

    Related tools