My Tools Garage

.env to JSON Parser

Parse a .env file into clean JSON.

in-browser
JSON

How to use

  1. 1 Paste the contents of your .env file into the input.
  2. 2 The parser strips export, comments and blank lines automatically.
  3. 3 Quoted values are unquoted and escapes decoded.
  4. 4 Read the parsed table, then copy or download the JSON.

About .env to JSON Parser

The .env to JSON parser reads a dotenv file and produces a clean JSON object of its variables, along with a quick key/value table so you can scan everything at a glance.

The dotenv format is the de-facto way to configure Node, Python, Docker and dozens of frameworks, but its small dialect quirks trip people up: this parser handles a leading export keyword, single- and double-quoted values, whole-line and trailing # comments, and blank lines.

Double-quoted values decode the usual \n, \t and \\ escapes, while single-quoted values are taken literally, exactly as the major dotenv libraries behave.

Turning a .env file into JSON is handy when you need to load configuration into a tool that expects structured data, audit which variables are set, generate documentation, or seed a secrets manager.

Crucially, a # inside a quoted value is preserved rather than being mistaken for a comment, so passwords and tokens containing hashes survive intact.

This is exactly the kind of data you should never paste into a random website, which is why My Tools Garage runs everything in your browser.

Your environment variables — API keys, database URLs, tokens — are parsed locally and never uploaded.

Paste a file and copy the JSON, or read the parsed table below.

FAQ

Are inline # comments handled?

Yes. A # starting a line, or following whitespace on an unquoted value, begins a comment. A # inside a quoted value is kept as part of the value.

What is the difference between single and double quotes?

Double-quoted values decode escape sequences like \n into real newlines; single-quoted values are treated literally, with no escape processing — matching standard dotenv behaviour.

Is it safe to paste secrets?

Yes. Parsing runs entirely in your browser. Your variables are never transmitted to any server.