.env to JSON

Convert .env files to JSON and back

About .env to JSON

.env to JSON parses KEY=VALUE lines into a JSON object, and can also convert a flat JSON object back into .env lines, entirely in your browser — nothing is uploaded to a server. It skips blank lines and lines starting with #, and strips a single matching pair of surrounding quotes from each value; it doesn't expand variable references like ${OTHER_VAR} or support multi-line values.

How to use .env to JSON

  1. 1Paste your .env content into the input box, or a flat JSON object to convert the other way.
  2. 2Click '.env to JSON' or 'JSON to .env' depending on the direction you need.
  3. 3Review the result in the output box.
  4. 4Click 'Copy' to copy it to your clipboard.

Frequently Asked Questions

Is .env to JSON free to use?

Yes, it's completely free with no signup required.

What .env syntax does it understand?

KEY=VALUE lines, blank lines, and # comments (both ignored). A single pair of surrounding single or double quotes is stripped from each value.

Does it expand variable references like ${OTHER_VAR}?

No, values are taken literally as plain text — variable interpolation isn't resolved.

Is my data uploaded to a server?

No, parsing and conversion happen entirely in your browser.

Tips & Tricks

  • Every value becomes a string in the resulting JSON, even ones that look numeric or boolean — convert types yourself if your application needs them typed.
  • JSON to .env only works with a flat JSON object; nested objects or arrays as values will be stringified oddly rather than expanded.
  • Comments and blank lines are dropped when converting .env to JSON, so JSON to .env won't reproduce them.
  • Since output may contain secrets like API keys, avoid pasting it somewhere it could be logged or committed to version control.