Category: Developer tools

dotenv to JSON

System ideaMissing a tool?

Convert .env files into a JSON object

Paste .env-style KEY=value text and get a JSON object, with comments, blank lines, the export keyword and quoted values all handled the way common .env parsers do. Runs entirely in your browser.

JSON
{
  "PORT": "3000",
  "NODE_ENV": "production",
  "API_BASE_URL": "https://api.example.com",
  "FEATURE_FLAG_BETA": "true",
  "DATABASE_URL": "postgres://user:pass@localhost:5432/app"
}

Everything on this page is processed in your browser. Nothing is uploaded.

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

Environment files use a simple but slightly fiddly format: comments starting with #, an optional export prefix, and values that may be unquoted, single-quoted or double-quoted with escape sequences. This tool parses that format line by line and produces a flat JSON object with one string value per key, so you can inspect, diff or feed a .env file into tooling that expects JSON.

How to use it

  1. Paste your .env content, or load the example.
  2. Copy the resulting JSON object.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

Is my .env file uploaded anywhere?
No. Parsing happens in JavaScript running in the page, so secrets in your .env file never leave your device.
What happens to comments and blank lines?
They're skipped entirely; only KEY=value lines contribute a property to the resulting JSON object.
Are all values converted to strings?
Yes, matching how .env files actually work: every value is text, even ones that look like numbers or booleans, so the JSON output keeps them as strings.