.env to JSON
Parse a .env file into a JSON object, handling quotes, comments and "export" prefixes.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/env-to-json \
-H 'Content-Type: application/json' \
-d '{"input":{"text":"# app\nPORT=8080\nexport NAME=\"My App\"\nDEBUG=true # on","indent":0}}'
import json, urllib.request
body = {'input': {'text': '# app\nPORT=8080\nexport NAME="My App"\nDEBUG=true # on', 'indent': 0}}
request = urllib.request.Request("https://setget.net/v1/tools/env-to-json", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/env-to-json", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"text":"# app\nPORT=8080\nexport NAME=\"My App\"\nDEBUG=true # on","indent":0}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "env-to-json",
"input": {
"text": "# app\nPORT=8080\nexport NAME=\"My App\"\nDEBUG=true # on",
"indent": 0
}
}
{
"input": {
"text": "# app\nPORT=8080\nexport NAME=\"My App\"\nDEBUG=true # on",
"indent": 0
}
}
Endpoint: POST /v1/tools/env-to-json. Over MCP: run_tool with slug: "env-to-json".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
text |
string | yes | The contents of a .env file. Do not paste real secrets. |
indent |
integer | no | Spaces per level. 0 gives one compact line. Default: 2. From 0 to 8. |
Example
Input
{
"text": "# app\nPORT=8080\nexport NAME=\"My App\"\nDEBUG=true # on",
"indent": 0
}Result
{
"text": "{\"PORT\":\"8080\",\"NAME\":\"My App\",\"DEBUG\":\"true\"}",
"variables": 3,
"skipped": []
}Questions
- Is it safe to paste secrets?
- No. Input is processed in memory and not stored, but you should never send live credentials to any online tool. Replace them with placeholders first.
Related tools
- JSON to YAMLConvert JSON into clean block-style YAML, keeping key order.
json-to-yaml - Query string parserDecode a URL query string into JSON. Repeated names become arrays.
querystring-parse - CSV profilerSummarise each CSV column: type, blanks, distinct values, min, max, mean and top values.
csv-profile - CSV sort, filter and dedupeSort CSV by a column, keep rows containing some text, pick columns and remove duplicate rows.
csv-sort-filter-dedupe - CSV to JSONTurn CSV rows into a JSON array of objects, detecting numbers, booleans and blanks.
csv-to-json - CSV to Markdown tableTurn CSV into a Markdown table ready to paste into a README, issue or chat.
csv-to-markdown-table