.env · create🔥 popular🔒 100% client-side — never leaves your browser

.env Generator: build a .env file for your stack

Generate a .env file for your project in seconds: this .env generator combines ready-made key sets for 14 frameworks and services (Next.js, Django, Rails, Laravel, Stripe, Supabase and more), fills in fresh secrets in the format each framework expects, and groups everything by service.

By Aliniyaz Mamat · last reviewed

Be the first to rate
# Next.js
NEXT_PUBLIC_SITE_URL=http://localhost:3000
DATABASE_URL=postgresql://user:password@localhost:5432/mydb
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=VWSlXflLtMU5g6jmcBuO5L5q2rbAK8Wwm5D8XtPYCJM=
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
STRIPE_SECRET_KEY=sk_test_
STRIPE_WEBHOOK_SECRET=whsec_
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_
  • NEXT_PUBLIC_SITE_URL
    Next.js · http://localhost:3000
  • DATABASE_URL
    Next.js · postgresql://user:password@l…
  • NEXTAUTH_URL
    Next.js · http://localhost:3000
  • NEXTAUTH_SECRET
    Next.js · VWSlXflLtMU5g6jmcBuO5L5q2rbA…
  • NEXT_PUBLIC_SUPABASE_URL
    Next.js · empty
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
    Next.js · empty
  • SUPABASE_SERVICE_ROLE_KEY
    Next.js · empty
  • STRIPE_SECRET_KEY
    Next.js · sk_test_
  • STRIPE_WEBHOOK_SECRET
    Next.js · whsec_
  • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
    Next.js · pk_test_

click any row's copy button to grab just that line

Key takeaways

  • ✓14 stacks: Node.js, Next.js, React (Vite), Django, Python, Rails, Laravel, Go, Docker, Kubernetes, Stripe, Firebase, Supabase and OpenAI/Anthropic.
  • ✓Select several (e.g. Next.js + Stripe + Supabase); shared keys like DATABASE_URL appear once.
  • ✓Secrets use each framework's real format: Laravel APP_KEY as base64: + 32 bytes, Rails keys as hex, NEXTAUTH_SECRET as base64 of 32 bytes, others as 48 random bytes.
  • ✓Service credentials (Stripe, Supabase, OpenAI keys) can't be generated: those come from each provider's dashboard and are left as empty or prefix placeholders.
  • ✓Regenerate gives new secrets every time; everything happens in your browser.

What it does

  • ▸Key sets for 14 frameworks and services
  • ▸Combine stacks into one file, grouped by service
  • ▸Framework-correct secret formats (Laravel, Rails, Auth.js, Django)
  • ▸Search keys, copy single values or the whole file
  • ▸Download as .env, 100% client-side

Privacy

Runs 100% in your browser. Your .env never touches our servers.

client-side only

When to use this tool

  • →Starting a new project and not wanting to look up every variable name
  • →Adding Stripe or Supabase to an existing app and checking which keys it needs
  • →Writing a .env.example for a repository (generate, then strip values with the .env.example generator)
  • →Teaching or documenting a stack's configuration

Common mistakes

  • ⚠Committing the generated file: it contains real secrets from the moment it's generated
  • ⚠Using the same generated secrets for development and production. Generate again for each environment
  • ⚠Leaving placeholder values like sk_test_ in place and wondering why Stripe returns 401
  • ⚠Keeping keys you don't use: every unused secret is one more thing that can leak

What each stack includes

StackKeys (examples)Detailed page
Next.jsNEXTAUTH_SECRET, Supabase, Stripe keysNext.js .env
Node.jsPORT, DATABASE_URL, JWT_SECRETNode.js .env
DjangoSECRET_KEY, ALLOWED_HOSTS, Redis, CeleryDjango .env
RailsRAILS_MASTER_KEY, SECRET_KEY_BASERails .env
LaravelAPP_KEY, DB_*, REDIS_*Laravel .env
Stripesecret, publishable, webhook, price IDsStripe .env
SupabaseURL, anon key, service role keySupabase .env
Docker / KubernetesPostgres, Redis, app settingsDocker .env

Every stack page explains its keys, shows how the framework loads them, and lists the errors people hit most. The rest: React, Python, Go, Kubernetes, Firebase, OpenAI.

From generated file to running app

  1. Generate, download, and save the file as .env (Next.js: .env.local) in the project root.
  2. Add .env* with an exception for .env.example to .gitignore: see how to hide .env from git.
  3. Replace placeholders with real service credentials from each dashboard.
  4. Check the result with the .env validator.
  5. For production, generate new secrets and set them in your host's environment settings instead of uploading the file.
# .gitignore
.env*
!.env.example

Why framework secrets need the right format

KeyExpected formatWhat happens with a wrong one
Laravel APP_KEYbase64: + base64 of 32 bytes"Unsupported cipher or incorrect key length"
Rails RAILS_MASTER_KEY32 hex characterscredentials can't be decrypted
Rails SECRET_KEY_BASE128 hex characters (by convention)works, but differs from bin/rails secret
NEXTAUTH_SECRET / AUTH_SECRETany long random string; base64 of 32 bytes by conventionMissingSecret if empty
Django SECRET_KEYany string ≥ 50 charactersdeploy check warning W009 if too short

For a single key with more options, use the dedicated generators: Laravel APP_KEY, Rails secret keys, NextAuth secret, Django secret key.

Frequently asked questions

Are the generated values real secrets I can use in production?

The generated secrets (JWT, session, framework keys) are cryptographically random and production-grade. Generate a separate set for production. Service keys (Stripe, Supabase, OpenAI) must come from the provider.

Which stacks and services are supported?

Node.js, Next.js, React (Vite), Django, Python, Ruby on Rails, Laravel, Go, Docker, Kubernetes, Stripe, Firebase, Supabase and OpenAI/Anthropic. Each has its own page under /env-generator/.

Can I combine multiple stacks?

Yes. Select as many as you need; the file gets one # Stack section per selection and keys that appear in several stacks are written once.

Should I commit the generated file?

No. Commit a .env.example with empty values instead; the .env.example generator makes one from this output.

Is anything generated on your server?

No. Keys and secrets are created in your browser with the Web Crypto API.

Related tools

Learn more

coming soon

Get notified when env syncing launches

We're building a tiny tool to keep .env files in sync across teammates and environments. Leave your email — no spam, just a single launch ping.

We use your address only for this launch email. You can ask us to delete it at any time. Privacy policy