Dotenv Converter
Parse a .env file into a structured key–value table and convert it to JSON (and back). The parser follows the common dotenv conventions: blank lines and # comment lines are skipped, an optional export prefix is stripped, values may be single- or double-quoted, double-quoted values process escape sequences (\n, \t, \\, \") and can span multiple lines, while single-quoted values are literal. Unquoted values are trimmed and may carry a trailing # inline comment. Duplicate keys take the last value. Everything runs locally in your browser — paste a .env in the left box (or JSON in the right) and convert.
.env input
JSON input / output
Variables
A .env file stores environment variables as KEY=value lines, one per line. This tool parses them into a structured object you can inspect or export as JSON. Rules: lines starting with # (after optional leading whitespace) are comments and ignored; so are blank lines. An optional leading export is stripped from the key. Values may be wrapped in double quotes (which process C-style escapes — \n newline, \t tab, \r, \\, \", \' — and may run across multiple lines) or single quotes (literal, no escapes, also multi-line). Unquoted values are taken verbatim up to a trailing # inline comment and are trimmed of surrounding whitespace. Empty values (KEY=) become the empty string. When a key repeats, the last definition wins. Converting back to .env quotes a value automatically if it contains spaces, #, =, quotes, or newlines, and escapes backslashes and quotes inside double quotes. Pairs with the JSON Formatter, YAML Converter, and CSV↔JSON tools. Everything runs locally — nothing leaves your browser.