🔒 Runs in your browser — nothing is uploaded✓ Free, no signup

.env Parser & Converter

Paste a .env file to check it and convert it to JSON, YAML, shell exports, docker run flags or Kubernetes env entries — or turn a JSON object into a .env file.

0 characters

Output

When should you use the .env Parser?

  • Moving environment variables into Kubernetes, Docker or CI settings
  • Finding duplicate or malformed lines in a .env file
  • Creating a .env file from a JSON config

How to use the .env Parser

  1. 1

    Paste your .env

    Comments, export prefixes, quotes and multi-line values are understood.

  2. 2

    Pick a format

    JSON, YAML, shell export, docker run -e, Kubernetes env or a cleaned .env.

  3. 3

    Check warnings

    Duplicate keys and invalid lines are listed under the output.

  4. 4

    Or go the other way

    Switch to JSON → .env. Nested keys are flattened (db.host → DB_HOST).

Examples

.env to typed JSON

.env

# Database
DB_HOST=localhost
DB_PORT=5432
API_KEY="abc 123"

JSON

{
  "DB_HOST": "localhost",
  "DB_PORT": 5432,
  "API_KEY": "abc 123"
}

Common errors and how to fix them

A line was skipped
Each line must be KEY=value. Keys can only contain letters, numbers, _ . and -, and can't start with a number.
A value was cut at #
Unquoted values end at ' #' (an inline comment). Wrap the value in quotes to keep the # character.
Related tools: Docker Run to Compose · YAML to JSON Converter · JSON Formatter

More from Code Formatters & Minifiers

Free tools that run in your browser — no signup, nothing uploaded.

.env Parser FAQ

The dotenv format used by Node, Python, Docker Compose and others: KEY=value, # comments, optional export, single, double and backtick quotes, \n escapes in double quotes and multi-line quoted values.

The last value wins, as in most dotenv libraries, and a warning tells you which key was duplicated.

Only if you tick 'Numbers and booleans as JSON types'. Otherwise every value stays a string, as environment variables always are.

Parsing happens entirely in your browser and nothing is sent anywhere. Still, rotate any secret you've shared somewhere you didn't intend.

Keys are uppercased, nested objects are joined with _ and values with spaces or special characters are quoted.

No. Everything runs in your browser, so your .env file never leaves your device.