ENV to JSON Converter

Runs in your browser — your data is never uploaded.

Turn dotenv content into JSON — for a config loader, a CI secret payload, or just to see what is actually set. It follows dotenv’s own rules: export prefixes are stripped, comments and blank lines ignored, double-quoted values have their escapes expanded while single-quoted ones stay literal, and an inline comment after a value is removed without eating a # that sits inside quotes. Everything runs in your browser, which matters more here than almost anywhere else on this site: a .env file is, by definition, your secrets.

0 characters · runs entirely in your browser

How to use ENV to JSON

  1. 1

    Paste the contents of your .env file.

  2. 2

    The key/value pairs are parsed as you type.

  3. 3

    Copy the JSON, or download it.

Share

Embed this tool on your site

Paste this where you want the tool to appear. It runs entirely in your visitor's browser — no uploads, no account, no tracking.

Please keep the attribution line — it's what keeps these tools free.

Need a different size, a dark theme, or a different tool? Build an embed lets you preview it first.

Frequently asked questions

Is it safe to paste real secrets here?+

The parsing runs entirely in your browser and nothing is transmitted — you can disconnect from the network and it still works. That said, the safest habit with any secret is to assume any page could be wrong: prefer a redacted copy when you only need the shape.

How are quotes handled?+

Double-quoted values expand escapes, so "line1\nline2" becomes a real newline. Single-quoted values are literal, so nothing inside them is interpreted. This matches dotenv, so a file that works locally converts the same way here.

What about comments at the end of a line?+

They are removed. A # inside quotes is kept, since it is part of the value — that distinction is what separates a correct parser from a find-and-replace.

Does it expand ${VARIABLE} references?+

No. Variable interpolation is a feature of some dotenv implementations and not others, and guessing wrong would silently change your config. Values come through exactly as written.

Why was one of my lines skipped?+

Lines without an = are ignored, as are keys that are not valid environment variable names — a name cannot begin with a digit, for example.