Boneyard Tools

.env to JSON Converter

Paste a .env file to get clean JSON, or flip the direction to turn JSON back into dotenv lines. Comments and blanks are dropped, quotes are stripped and export is handled. Your secrets stay in your browser.

How to convert .env to JSON

  1. Paste your .env file (or JSON object) into the editor.
  2. Pick a direction: .env to JSON, or JSON to .env.
  3. Copy the result or download it as a file.

Examples

Dotenv to JSON

PORT=3000
# comment
NAME="My App"
export TOKEN=abc
{
  "PORT": "3000",
  "NAME": "My App",
  "TOKEN": "abc"
}

Frequently asked questions

Are my secrets uploaded anywhere?

No. The conversion runs entirely in your browser, so the values in your .env file never leave your device or get sent to a server.

How are comments and blank lines handled?

Lines starting with # are treated as comments and dropped, and blank lines are ignored. Only KEY=value lines end up in the output.

Does it support the export prefix?

Yes. A leading 'export ' (as in export KEY=value) is recognised and removed, so the key comes out clean.

What about quotes and values that contain an equals sign?

A single pair of surrounding single or double quotes is stripped from each value. Values keep everything after the first equals sign, so URL=postgres://a=b stays intact.

Are numbers and booleans converted to real types?

No. Dotenv values are always strings, so PORT=3000 becomes the string "3000". This matches how process.env behaves at runtime.

Can I convert JSON back into a .env file?

Yes. Switch the direction to JSON to .env and the tool writes KEY=value lines, quoting any value that contains spaces.

Related tools