Skip to content

Convert between .env files, JSON and YAML, with validation of keys and quoting.

Loading tool

About .env Converter

Convert a .env file, flat JSON object or YAML mapping into .env, JSON, YAML, docker run -e flags or a Kubernetes ConfigMap. The parser handles comments, export prefixes, single, double and backtick quotes, multi-line values and ${VAR} or ${VAR:-default} expansion, and reports missing equals signs, unterminated quotes, duplicate keys and non-portable variable names. Because .env files often hold passwords and API keys, it matters that parsing runs entirely in your browser.

Common uses

  • Turn a .env file into a Kubernetes ConfigMap manifest
  • Generate docker run -e flags from a .env file
  • Find duplicate keys and quoting mistakes in a .env file
  • Convert a JSON config object into .env format

FAQ

Should secrets go in a ConfigMap?
No. ConfigMaps are meant for non-sensitive configuration. Store passwords, tokens and keys in a Kubernetes Secret, and note that Secrets are only base64-encoded by default, not encrypted, unless encryption at rest is configured.
Are values in a .env file typed?
No. Environment variables are always strings, so the JSON and YAML output keeps every value as a string, even ones that look like numbers or booleans.
What happens when a key is defined twice?
The later value wins, which matches how most dotenv loaders behave, and the tool shows a warning pointing to the line of the first definition.