Back to Free Tools
FREE TOOLS
Dotenv and JSON Converter
Convert flat string JSON and a named literal dotenv grammar, with quotes, comments and export prefixes but no expansion.
Strict UTF-8 DTH literal dotenv v1, Flat strict JSON object of strings
Flat string JSON object, Double-quoted literal dotenv text
Browser only
Runs locally in your browser. Your files, pasted content and generated output are not uploaded. Reset clears this tool’s working data.
This tool needs JavaScript. If it does not load, refresh the page and try again.
How to use this tool
- Choose Direction and paste Dotenv or JSON input, or choose one file. Files take precedence.
- Use ASCII identifier names. Dotenv accepts blank/comment lines, optional export, horizontal whitespace, single literal quotes and enumerated double-quote escapes. Unsupported expansion or ambiguous syntax rejects.
- Select Convert, then Download result for environment.json or environment.env. Dotenv output uses LF and one terminal LF; an empty JSON object emits one LF.
Examples
A=one#two retains the hash; A=one #comment yields one. A single-quoted backslash+n stays literal, while double-quoted escape n yields a newline.
Limitations
- 1 MiB input,10000 assignments,1–300 ASCII identifier characters per name,5 MiB output and 30 seconds.
- Double quotes admit backslash, quote, n, r, t, b, f, uXXXX with valid scalar pairing, escaped dollar and escaped backtick. Rejects unknown escapes, multiline quotes, NUL, invalid Unicode and duplicate names.
- CRLF/CR/LF records and at most one initial BOM are admitted. Unquoted quote/backslash/dollar/backtick forms reject. No OS environment read, shell sourcing, commands or variable expansion.
- JSON must be a flat object of strings; no nested flattening, non-string coercion or universal dotenv portability.
Related tools
No items found.