Environment File Converter: convert .env, JSON, YAML and Kubernetes ConfigMaps and Secrets in either direction.
How to Convert Environment Files - Complete Guide
Input Environment Configuration
Start by providing your environment configuration in any format. Whether you're working with .env files, JSON configs, YAML, or Kubernetes ConfigMaps, our tool intelligently auto-detects the format:
.env, JSON, YAML, or K8s manifest and paste into the editorExample: Environment Variables (.env format)
Here's what a typical .env file looks like:
DATABASE_URL=postgresql://user:pass@localhost:5432/db REDIS_HOST=localhost REDIS_PORT=6379 API_KEY=your-secret-api-key NODE_ENV=production
Select Output Format
Choose your desired output format based on your deployment target. Our converter supports multiple popular formats for different use cases:
Format Comparison
Choose the right format for your use case:
Instant Conversion with Smart Detection
The conversion happens in real-time as you type or select a different output format. Our intelligent parser handles all the complexity:
Example: Kubernetes ConfigMap Output
The same variables, now as a Kubernetes ConfigMap:
apiVersion: v1 kind: ConfigMap metadata: name: app-config data: DATABASE_URL: postgresql://user:pass@localhost:5432/db REDIS_HOST: localhost REDIS_PORT: '6379' NODE_ENV: production
Copy or Download Your Configuration
Once converted, you can easily use the output in your projects. Download as a file or copy to your clipboard with one click:
env_file reads quoted values like dotenv does; docker run --env-file does not strip quotes, so only use it with files whose values are all barekubectl apply -f config.yamlQuick Usage Examples
How to use the converted files:
# Load .env in Dockerdocker run --env-file .env my-app# Apply Kubernetes ConfigMapkubectl apply -f app-config.yaml# Load in Node.jsrequire('dotenv').config()Frequently Asked Questions
What can I paste in, and how does it know which format it is?
A .env file (NAME=value lines, with or without export), a JSON object, a YAML map, or a Kubernetes ConfigMap or Secret manifest in YAML or JSON. Input that starts with { is read as JSON, input whose first line is NAME=value is read as .env, and anything else is read as YAML. If something can't be read, the error tells you the line and column.
Will my values change on the way through?
No. Every variable is a piece of text, so 00501 keeps its leading zeros, 14.50 keeps its trailing zero, a 19-digit ID keeps every digit, and true or 2024-01-15 stay text instead of turning into a boolean or a date. In YAML and Kubernetes output, values that a YAML reader would otherwise treat as numbers or booleans are quoted so they stay strings. Nested JSON or YAML is flattened into one name per value, joined with _ (db.host becomes db_host), because an env file can only hold NAME=value pairs.
How are Kubernetes Secrets encoded?
Each value in the Secret's data section is the Base64 of its UTF-8 bytes, which is what kubectl expects, so accented letters and emoji decode correctly. Paste a Secret back in and the values are decoded the same way. Base64 is only an encoding, not encryption: anyone who can read the manifest can read the values, so treat a Secret file like the plain .env it came from.
Is my data sent anywhere?
No. The conversion runs in your browser, and nothing you paste or upload is sent to a server. Still, avoid pasting production secrets into any web page you do not control.
How are quotes, # signs, $ and line breaks handled in .env files?
When reading a .env file, a # after a space starts a comment, but a # inside a quoted value or in the middle of a word (like a URL fragment) is kept. Double-quoted values understand \n and other backslash escapes, single-quoted values are taken literally, and quoted values can run over several lines. When writing a .env file, plain values stay bare and anything with spaces, # or $ is quoted so python-dotenv and Node's dotenv read back exactly what you had; if your loader expands ${NAME} references, turn that off (python-dotenv: interpolate=False).
What's the difference between a ConfigMap and a Secret?
Both hold key-value data your pods can load with envFrom. ConfigMaps are meant for ordinary settings such as URLs and feature flags. Secrets are meant for passwords and tokens: Kubernetes can encrypt them at rest and limit who may read them, but the manifest itself only Base64-encodes the values. The resource name you type is cleaned to a valid Kubernetes name (lowercase letters, digits, - and .) and the output tells you if it changed.
Related Tools
Docker Compose to Kubernetes
Convert Docker Compose files to Kubernetes manifests with Deployments, Services, and PVCs
Kubernetes to Docker Compose
Convert Kubernetes manifests to Docker Compose format for local development
Kubernetes YAML Fixer
Fix broken Kubernetes manifests automatically, repair Deployment, Service, Pod, and ConfigMap YAML errors
Docker Compose to Helm
Generate complete Helm charts from Docker Compose files with templates and values
Kubernetes to Helm Chart
Generate Helm charts from Kubernetes manifests with Chart.yaml, values.yaml, and templates
Helm to Kubernetes
Convert Helm charts to plain Kubernetes manifests by rendering templates with values