.env to JSON Converter

Convert environment files to JSON and back. Comments are ignored, quoted values are unescaped, and duplicate keys are reported. Everything stays in your browser.

0 characters

Supports comments, an export prefix, single or double quotes and inline comments.

JSON output

Conversion rules

  • Blank lines and lines starting with # are ignored.
  • A leading export is removed, so shell-ready files work unchanged.
  • Double-quoted values understand \n, \r, \t, \" and \\.
  • Unquoted values lose a trailing comment that starts with whitespace followed by #.
  • Duplicate keys are kept once with the last value, and the duplicate is reported.
  • Going back to .env, values containing spaces, quotes or # are double-quoted automatically.

Need to reshape the JSON? Use the JSON Formatter or convert YAML with the JSON ↔ YAML / CSV Converter.

More from Developer Tools

Browse all 127 tools →

Build custom software with us

From internal tools to full platforms — we deliver end to end.

Was this tool useful?