.env to JSON Converter

Convert .env files to JSON and JSON back to .env — handles quotes, comments, export and nested keys.

Runs instantly in your browser — results update as you type.

How do I convert a .env file to JSON?

Paste a .env file and get a JSON object of all KEY=value pairs — quotes, escaped characters, export prefixes and # comments are handled, and you can turn true/false and numbers into JSON types. Paste JSON instead and nested keys are flattened into UPPER_SNAKE_CASE .env lines.

When you need it

  • Moving settings between Docker, Node.js (dotenv), Laravel, Vercel, Netlify or AWS.
  • Creating JSON config for CI pipelines or secret managers.
  • Turning a JSON config into environment variables.

Keep secrets safe

The conversion runs entirely in your browser, but never commit .env files with real passwords or API keys to Git — add .env to .gitignore.

Frequently asked questions

Is my data uploaded?

No, everything stays in your browser.

What happens with duplicate keys?

The last value wins and you get a warning.

Are multiline values supported?

Yes, written as \n inside double quotes.