Dotenv syntax
Comments, export prefixes, empty values and inline # comments after unquoted values.
Parse dotenv files into JSON, privately in your browser.
Convert .env (dotenv) files to JSON. Handles comments, export prefixes, quoted and multi-line values, and optional nesting on double underscores.
# Local settings
PORT=8080
DATABASE_URL="postgres://localhost:5432/app"
export DEBUG=true{
"PORT": "8080",
"DATABASE_URL": "postgres://localhost:5432/app",
"DEBUG": "true"
}Tip: Use JSON to .env to go the other way when you need to write an env file from a config object.
Comments, export prefixes, empty values and inline # comments after unquoted values.
Double quotes support \n escapes and multiple lines; single quotes are taken literally.
Keep every value as a string (as process.env does), or detect numbers and booleans.
Turn DATABASE__HOST into {"DATABASE": {"HOST": ...}} with the double-underscore option.
The file is parsed in your browser and nothing is uploaded. As with any tool, avoid pasting production secrets on shared computers.
Environment variables are always strings; that matches what your app receives. Turn on detection if you need typed JSON.
No. ${OTHER_VAR} is kept as written, so you can see exactly what the file contains.
Files used by dotenv for Node.js, python-dotenv, Docker Compose env_file and most frameworks.