Convert ENV to JSON
Turn ENV files into JSON. Each KEY=value line becomes a key in file order; export prefixes, quotes, escapes and trailing comments are handled, and unquoted numbers and booleans are typed.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop ENV files on the dialor turn it to pick what to do
Your .env file as one JSON object.Each KEY=value line becomes a key, in the order of the file.
What you get
One JSON file. Every KEY=value line becomes a key in file order, so the JSON reads the same way as the ENV file from top to bottom.
Export prefixes, quotes, escapes and trailing comments are handled. Unquoted numbers and booleans are typed, so they come out as numbers and booleans in the JSON.
Special cases
A key with no value becomes null. A repeated key becomes a list, so no value from the file is lost.
References written as ${VAR} stay as written. They are not looked up or filled in, so the JSON holds the same text the ENV file holds.
Going back
To turn the data into an ENV file again, use JSON to ENV. To see the other conversions for this format, open every ENV conversion.
ENV and JSON.What each format is.
The formats
Dotenv
KEY=value lines that hold environment variables for an app.
- Extensions
- .env
- MIME type
- text
/x -env - Kind
- Text and data
JSON
JSON, the data format of every API.
- Extensions
- .json
- MIME type
- application
/json - Kind
- Text and data
In your code.The same ENV to JSON conversion through the API, for your app or your agent.
$ cv convert report.env report.json$ cv convert report.env report.jsonQuestions.What people ask about ENV to JSON.
Yes. Each key appears in the same order as its line in the ENV file.
Yes, when they are unquoted. An unquoted number becomes a JSON number, and an unquoted boolean becomes a JSON boolean.
It becomes null in the JSON.
A repeated key becomes a list, so both values are kept.