ENV to JSON converter

Paste a .env file (the standard KEY=value format with optional comments and quoted strings) and get back clean JSON. Handy when porting environment config to a JSON-based tool, secret manager, or API call.

ENV to JSON

Supported syntax

  • Comments with # at the start of a line or after a value (only when value isn't quoted).
  • Quoted values: single quotes, double quotes, or backticks. Escape sequences (\n, \t, \") are interpreted inside double quotes.
  • Empty values: KEY= becomes "KEY": "".
  • "export" prefix (Bash style) is stripped: export KEY=value works.
  • Type coercion (optional): true/false/null and pure numbers are converted to native JSON types.

FAQ

Does this support variable substitution like $VAR?

No — substitution requires evaluating values in order with knowledge of the running shell, which is brittle. The output is a literal one-to-one mapping of every line.

Are values uploaded?

No. Conversion is fully client-side. Useful when the file contains real secrets you don't want to paste into an unknown tool.

Related calculators