ENV and JSON converter
Convert .env assignments to a string-valued JSON object or environment list, with exact value checks.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Move configuration between Node-style .env assignments and a JSON object or environment name/value list. Values stay strings, and the reverse conversion checks that every value survives a round trip.
How to use this tool
- Choose ENV → JSON or JSON → ENV above the input. For ENV → JSON, choose an object or environment name/value list.
- Paste text or open one UTF-8 .env, .json or .txt file for the selected direction.
- Review the variable count, convert, then copy or download the complete result.
Supported inputs and limits
Supports explicit assignments, optional export, comments, and single, double or backtick quotes including multiline values. Double-quoted \n becomes a newline, as in Node .env parsing; no variable expansion.
JSON → ENV accepts a top-level object of strings or an environment array of unique name/value strings. Valid variable names and exact representability are required.
This tool only processes input text; it does not run or send commands found in it.
Files and input are processed in this browser. No account needed.
Worked example
Example input
APP_NAME=Mori PORT=3000
Example options
{}Example output
{
"APP_NAME": "Mori",
"PORT": "3000"
}When something does not work
Check the direction, variable names and quotes. Duplicate names, non-string values and values that cannot round-trip exactly are rejected.
Frequently asked questions
What does each direction produce?
ENV → JSON can return a string object or an ordered environment name/value list. JSON → ENV accepts either form with string values and produces one assignment per name. Choose the direction before adding input.
How can I check the result from ENV to JSON?
Review secrets before sharing. Comments are omitted; values remain strings; variable references are not expanded.
What should I check before using the result?
This follows a strict Node-style .env subset, not a shell script. Unrepresentable values, duplicate names and non-string JSON values are rejected rather than changed.
Is my input sent to a server?
No. Tool input is processed in your browser, not sent to a server. Temporary workspaces stay in the same tab and are cleared by a refresh or tab closure. Save the results you need.
Documentation & further reading
Related tools
JSON formatting workspace
Format or minify strict JSON, sort object keys, and encode or decode strings while preserving raw number tokens.
Regex tester
Try a pattern and see what it matches in your text.
Compare text
See what changed, side by side.
HTML formatter
Format HTML indentation so its structure is easier to read.