Skip to content
~/json-to-.env-converter
$

JSON to .env Converter

Convert JSON secrets from AWS Secrets Manager, Vault, or any JSON source into a .env file. Handles nested objects, quoting, prefixes, and more.

Load example:
JSON Input
.env Output8 vars

Options

Prepended to every key

Used to flatten nested keys

How it works

  • Paste any JSON object — flat or nested (e.g. from AWS Secrets Manager, Vault, GCP Secret Manager)
  • Nested keys are flattened: database.host becomes DATABASE_HOST
  • Values with spaces, special chars, or $ are quoted automatically
  • Arrays become comma-separated strings

What Is a .env File?

A .env file stores environment variables as KEY=VALUE pairs, one per line. Frameworks like Docker Compose, Next.js, and Rails load them automatically, keeping secrets and configuration out of your source code.

How the Conversion Works

Paste JSON from AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault, or any other source. Nested keys are flattened with underscores, and you can set a prefix, choose a quoting style, and download the result as a ready-to-use .env file.

Why Convert JSON to .env?

Cloud secret managers typically export secrets as JSON, but local development workflows expect .env files. This tool bridges that gap so you can go from a Secrets Manager export to a working .env in seconds.