Skip to content
Jellykit

.env and INI Converter

Convert .env and INI files to JSON or YAML and back in your browser, with every repeated key pointed out by its line number.

  • Runs on your device
Loading tool

About .env and INI Converter

Turn a .env file into JSON for a script or a secrets manager, an INI file into YAML for a newer tool, or a JSON settings object into a .env file a container can load. The format of what you paste is detected, and you choose what comes out.

Repeated keys are easy to miss in a long configuration file and decide which value a program ends up with, so every one is listed with its line numbers. Values stay text unless you ask for numbers and true/false to be read as such, because that is how programs receive them from these files.

How it works

  1. .env files are read by the rules of the dotenv library: an optional export, # comments outside quotes, single quotes and backticks kept as written, \n and \r in double quotes turned into line breaks, and quoted values that run over several lines.
  2. INI files are read with [sections], name = value or name: value lines, ; and # comments, quoted values and name[] = value lines gathered into a list. A bare name on its own line counts as switched on.
  3. When a key appears twice, the last value wins, as it does in most programs, and the result lists every repeated key with the lines it is on.
  4. Writing a .env file joins nested keys with underscores and quotes values only where needed. Writing INI puts nested groups into sections named with dots, such as [server.tls].

Questions

Why does a # cut my .env value short?

Outside quotes, # starts a comment in a .env file, as the dotenv library reads it. Put the value in quotes, such as "pa#ss", to keep the # as part of it. When this tool writes a .env file, it quotes such values for you.

Are comments kept?

No. JSON has no comments, and the output is rebuilt from the settings, so comments are dropped in every direction. The result says so when the input had some.

Are ${VAR} references expanded?

No. A value such as ${HOME}/data is kept exactly as written. Expansion depends on the program that loads the file, so this tool does not guess.

Is there a size limit?

The input can be up to 5 MB. JSON and YAML may be nested up to 64 levels deep and hold up to 200,000 values.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.