ENV to JSON Converter
Convert .env files to a JSON object of strings, or write a JSON object as dotenv assignments. Set indentation, inspect values and swap outputs.
Round-Trip Dotenv and JSON Values
ENV to JSON Converter: how to use it
- Choose a direction, then paste the source or open a local file.
- Select Node.js quoting or JSON-style escapes. When exporting JSON, choose two spaces, four spaces or a tab.
- Convert, then review, copy or download the result. Swap input and output to check the reverse conversion.
Limits and notes
Up to 262,144 input UTF-16 code units and 10,000 dotenv lines or top-level JSON properties. The tool reports duplicates and malformed input. JSON values become strings in dotenv and keep their original number spelling. Node.js quoting reports values it cannot preserve.
How your privacy works →ENV to JSON Converter: common questions
Will leading zeros and false stay as typed?
A dotenv value such as 0012 or false becomes a JSON string. When importing JSON, a number or boolean becomes text in the dotenv file.
What happens to nested JSON?
Each top-level key becomes one variable. An object or array value stays together as JSON text, including its source number spellings.
Which syntax should I choose?
Choose Node.js quoting for Node's dotenv parser. Choose JSON-style escapes for double-quoted escapes such as an embedded quote or a tab when your next reader supports that dialect.