Free, browser-based utilities for everyday developer workflows

Convert .env to JSON

Instantly convert .env files to JSON objects (and back). Mask secret values before sharing with teammates or storing in documentation.

Try it now

Open .env ↔ Properties ↔ JSON Converter.

Try it now
When you need this
  • A teammate needs your dev environment config but you cannot share the actual secrets.
  • A tool you are integrating requires config as a JSON object, not a .env file.
  • You are migrating a Node.js service to a Java Spring app and need to convert .env to .properties format.
  • You want to document which environment variables your application needs without exposing values.
How to do it with Daily Developer Tools
  • Paste your .env content into the input box of the .env Converter.
  • Select JSON as the output format and click Convert.
  • Enable the Mask secrets option to replace values of keys containing SECRET, KEY, TOKEN, or PASSWORD with asterisks.
  • Copy or download the output JSON for sharing or use in another tool.
Tips / common pitfalls
  • Values with spaces must be quoted in .env files (VALUE="hello world"). The converter handles this automatically.
  • Comments (lines starting with #) are stripped during conversion to JSON.
  • Keys are case-sensitive in .env and JSON — DB_HOST and db_host are different keys.
  • Multi-line values use a backslash continuation or quote wrapping — check your format before converting.
Examples & test data

API service config with masked secrets

Open tool with this example
Input (.env)
# App config
APP_ENV=production
APP_PORT=3000
DB_HOST=db.internal
DB_PORT=5432
DB_PASSWORD=s3cretPassw0rd
STRIPE_SECRET_KEY=sk_live_abc123
JWT_SECRET=my-jwt-secret
Output JSON (secrets masked)
{
  "APP_ENV": "production",
  "APP_PORT": "3000",
  "DB_HOST": "db.internal",
  "DB_PORT": "5432",
  "DB_PASSWORD": "********",
  "STRIPE_SECRET_KEY": "********",
  "JWT_SECRET": "********"
}
FAQ
Are my secrets uploaded?

No. All conversion and masking runs entirely in your browser using JavaScript. Your .env content is never transmitted to any server.

What formats are supported?

The tool converts between .env (KEY=VALUE), Java .properties (key=value with comment and whitespace handling), and JSON object formats. Conversion works in any direction.

Can I mask specific keys?

Yes. The mask option detects keys containing common secret indicators (SECRET, KEY, TOKEN, PASSWORD, PRIVATE) and replaces their values with asterisks before output, making the result safe to share.

i Privacy-first: runs locally in your browser. No uploads.

How to convert a .env file to JSON

Paste your .env content, select JSON as the target format, and optionally enable the mask option to hide secret values. Click Convert and copy the output JSON.

Common use cases

Developers use this to share environment configs with colleagues without exposing API keys and passwords. DevOps engineers use it to translate .env files into the JSON format expected by AWS ECS task definition environment variables or GitHub Actions secret YAML. Teams migrating between languages use it to convert Node.js .env files to Java .properties without manual reformatting.

Why run this in your browser?

All processing happens locally in your browser. Your data never leaves your machine, making it safe for sensitive payloads, internal API responses, and confidential configurations.