Convert ENV to JSON5

Turn ENV files into JSON5. 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 JSON5.Each KEY=value line becomes a key, in the order of the file.

  1. What you get

    One JSON5 file with a key for every line of the ENV file, in the same order. Keys that are plain identifiers are written without quotes.

    Numbers and booleans that are not in quotes are typed, so a value like that is written as a number or a boolean instead of a string.

  2. How lines are read

    Export prefixes, quotes, escapes and trailing comments are handled, so they do not end up in the values.

    A key with no value becomes null. A key that appears more than once becomes a list of its values.

    References such as ${VAR} are not filled in. They stay in the value as written.

  3. Going back

    To turn JSON5 into an ENV file, use JSON5 to ENV.

ENV and JSON5.What each format is.

The formats

From · ENV

Dotenv

KEY=value lines that hold environment variables for an app.

Extensions
.env
MIME type
text/x-env
Kind
Text and data
To · JSON5

JSON5

JSON with comments, trailing commas and unquoted keys.

Extensions
.json5
MIME type
application/json5
Kind
Text and data

In your code.The same ENV to JSON5 conversion through the API, for your app or your agent.

terminal
$ cv convert report.env report.json5
$ cv convert report.env report.json5

Questions.What people ask about ENV to JSON5.

01OF 04

Yes. Keys come out in the order they appear in the ENV file.

It becomes null in the JSON5 file.

No. They stay as written in the value.

The repeated key becomes a list in the JSON5 file.

More conversions.Other ways in and out of ENV and JSON5.