Search DevFox

Search tools and pages.

ENV File Editor

Edit .env files in a key/value table with type detection, masked secrets, duplicate-key warnings, and export to JSON, YAML, shell, or docker-compose

Loading tool...

What is ENV File Editor

Written by Giorgos Kostas. Last reviewed:

ENV File Editor parses your `.env` content into a row-based table — every variable becomes an editable input, comments and blank lines round-trip unchanged, and a type badge tells you what each value looks like (URL, port, boolean, JSON, secret, list, number).

It is purpose-built for the editor workflow that the existing `.env to JSON` converter doesn't cover: secret masking by key name, duplicate-key warnings (later assignments shadow earlier ones), and one-click export to docker-compose `environment:` blocks, POSIX shell `export` lines, JSON, or YAML.

Why use it

  • Edit a `.env` without exposing secrets on screen during a screen-share — keys matching `*SECRET*`, `*TOKEN*`, `*KEY*`, `*PASSWORD*` are auto-masked.
  • Catch shadowed keys instantly — a later `DATABASE_URL=` overrides an earlier one, but it's easy to miss in raw text.
  • Convert a `.env` to a docker-compose `environment:` block (or YAML / JSON / shell exports) in one click.
  • Round-trip your file — comments and blank lines stay where you put them.
  • Validate that every key is POSIX-portable (warns on dashes, leading digits, lowercase, etc.).

Features

  • Key/value table with reorder + add/remove
  • Type detection: url, port, bool, json, list, number, secret, string
  • Auto-masked secrets by key name (SECRET, TOKEN, KEY, PASSWORD)
  • Duplicate / shadowed key warnings
  • Round-trip comments + blank lines
  • Export: .env, JSON, YAML, shell `export`, docker-compose environment

How to use ENV File Editor

  1. Paste or upload. Drop your `.env` content or upload the file.
  2. Edit in place. Click any key/value to edit. Use the toolbar to add comments or blanks.
  3. Inspect badges. Type badges flag misconfigurations; shadowed rows highlight in amber.
  4. Pick an export tab. Copy as JSON / YAML / shell / docker-compose, or download the cleaned `.env`.

Example (before/after)

Pasted .env

APP_PORT=3000
DATABASE_URL=postgres://user:[email protected]:5432/app
JWT_SECRET="change-me"
JWT_SECRET="this-overrides-the-previous"

Editor view

APP_PORT       = 3000           [port]
DATABASE_URL   = postgres://… [url]
JWT_SECRET     = ch••••••me   [secret] · shadowed
JWT_SECRET     = th••••••us   [secret]

Common errors

Quotes appear or disappear after editing

Values containing whitespace, `#`, or `"` need double-quoting; the editor adds them automatically.

Fix: Don't try to manually escape — the serializer reapplies quotes deterministically.

POSIX-portability warning on a key

Some shells refuse keys with hyphens or lowercase letters.

Fix: Stick to UPPER_SNAKE_CASE; the editor warns when a key isn't `[A-Za-z_][A-Za-z0-9_]*`.

Shadowed key warning

Two assignments to the same key — the second wins, but the first looks valid.

Fix: Delete the duplicate row, or move the intended value to be the last assignment.

FAQ

How is this different from the existing .env to JSON converter?

The converter is one-way: paste, get JSON. The editor is interactive: rename keys in place, reorder, mask secrets, see live JSON / YAML / shell / docker-compose exports, and download a properly-quoted `.env` back. Round-trip safety (comments and blank lines preserved) is the bigger differentiator.

Are secrets sent to a server?

No — parsing, validation, and export all happen in the browser. The masking is purely visual; the underlying value is still in the input field, just hidden. Toggle 'Show secrets' to reveal them.

Which keys count as 'secret'?

Anything matching the regexes for SECRET, PASSWORD, PASSWD, TOKEN, APIKEY/API_KEY, PRIVATE, KEYSTORE, or CREDENTIAL (case-insensitive). Override by editing the value with the show toggle on, or by renaming the key.

Does it handle multi-line values?

The serializer outputs `\n` inside double-quoted values, but the parser keeps multi-line dotenv values on a single row. Full multi-line block support (the dotenv-vault `"""` syntax) isn't covered yet.

Can I import a docker-compose file directly?

Not yet. Paste an `env_file:` reference contents instead. We're considering importing `environment:` arrays from compose YAML in a future iteration.

What does the docker-compose export look like?

It outputs a `services: app: environment: - KEY=value` block, ready to drop into a compose file. Rename the service after pasting.

Related tools

Pair the editor with related dev / DevOps tools. You can also browse the full DevOps & Infra category for more options.

.env to JSON Converter

Convert a .env (dotenv) file into structured JSON with quote, comment, and escape handling

Docker Compose Validator

Validate docker-compose.yml against the Compose Spec schema with hand-written lints (port collisions, undefined networks, depends_on cycles)

YAML Formatter

Format and beautify YAML content online with proper indentation and flow styles. Paste YAML and get clean, readable output instantly.

YAML Validator

Validate YAML syntax online and catch indentation and structure errors instantly. Paste YAML config files and get detailed error messages with line numbers.

JSON Formatter

Format, validate, and beautify JSON online with readable indentation, syntax checking, and copy-ready output for APIs, logs, and config files.

JSON Validator

Validate JSON syntax and catch parse errors instantly. Paste JSON and get immediate feedback on structural issues, missing commas, and unquoted keys.

Kubernetes YAML Explorer

Explore multi-document Kubernetes manifests grouped by kind with a cross-reference graph (Service to Deployment, ConfigMap mounts, Ingress backends)

Nginx Load Balancer Config Generator

Generate an nginx upstream + load balancer config with round-robin, least_conn, ip_hash, weights, health checks, and keepalive

Nginx Reverse Proxy Generator

Generate a production-ready nginx.conf for reverse proxying with proxy_pass, headers, timeouts, and gzip from a focused form

Nginx SSL Config Generator

Generate an HTTPS-ready nginx.conf with SSL certificate paths, modern protocols, ciphers, HSTS, and HTTP-to-HTTPS redirect

Nginx Static Site Config Generator

Generate an nginx.conf for serving a static site with try_files, SPA fallback, gzip, brotli, and aggressive cache headers

Nginx WebSocket Proxy Generator

Generate an nginx config for proxying WebSocket connections with Upgrade and Connection headers and long read timeouts