Developer

ENV to JSON Converter

Parse dotenv files into JSON and convert JSON keys back to .env format.

All tools

Input

Output

{
  "DATABASE_URL": "postgres://user:pass@localhost:5432/app",
  "DATABASE_POOL": "10",
  "NODE_ENV": "production",
  "DEBUG": "false",
  "SECRET": "s3cr3t with spaces"
}

Frequently asked questions

Are .env values typed or just strings?
Everything in a .env file is a raw string - there are no booleans, numbers, or nulls. Coerce values in your application code, for example by checking for "true" or parsing with Number().
Do I need quotes around .env values?
Quotes are only required when the value contains spaces, the # comment character, or you want to preserve newlines with escape sequences inside double quotes. Most simple values work fine unquoted.
What's the convention for variable names in a .env file?
Use uppercase letters, digits, and underscores, starting with a letter, like DATABASE_URL. Hyphens and dots are not portable across shells, and lowercase names work but clash with conventional shell style.