Config File Converter

Choose the format you have and the format you want, then paste the file. TOML, INI and .env are read strictly, and problems are reported with the line they are on.

TOML dates and times are kept as text in JSON. TOML has no null, so a null in JSON stops the conversion unless you leave nulls out. .env output uses upper case names joined with underscores.

Worked examples

TOML to JSON

[server] host = "localhost" ports = [8000, 8001]

{ "server": { "host": "localhost", "ports": [ 8000, 8001 ] } }

The table became an object and the array a list.

JSON to .env

{"db": {"host": "h", "pass word": "a b"}, "port": 3000}

DB_HOST=h DB_PASS_WORD="a b" PORT=3000

Names are in capitals, and a value with a space is quoted.

About Config File Converter

Settings live in many formats. JSON is used by tools and APIs, TOML by Rust, Python and many modern projects, INI by older programs and PHP, and .env files by twelve-factor apps and containers. Moving settings from one to another by hand means checking the quoting, nesting and types of each format, and a missing quote or a duplicate key is easy to miss.

This converter reads the format you have into plain data and writes the one you want. TOML is parsed to the 1.0 specification, including tables, arrays of tables, inline tables, dotted keys, multi-line strings, hexadecimal, octal and binary numbers, and dates and times. INI supports comments, quoted values, duplicate keys and optional nested sections. The .env reader supports export lines, quotes, multi-line values and ${NAME} references. Any mistake is reported with the line it is on.

How to use Config File Converter

  1. Choose the format you have and the format you want.
  2. Paste the file. Errors are reported with a line number.
  3. Set the options that apply: indent, type conversion, nested sections or leaving out nulls.
  4. Copy the converted file.

Common uses

  • Moving a project from a JSON config to TOML
  • Reading a TOML file as JSON to inspect it
  • Turning a JSON settings file into environment variables
  • Converting an old INI file for a modern tool

Frequently asked questions

How are TOML dates shown in JSON?

JSON has no date type, so dates and times are kept as text exactly as written, such as 1979-05-27T07:32:00-08:00.

What happens to null when writing TOML?

TOML has no null, so the conversion stops and names the key. Tick the option to leave nulls out instead.

How are INI types handled?

INI has only text. By default values stay as text. Tick the option to turn numbers and true or false into JSON values.

How are nested objects written as .env?

Names are joined with underscores and written in capitals, so {"db": {"host": "h"}} becomes DB_HOST=h. Lists are written as JSON text.

Does it check TOML strictly?

Yes. Duplicate keys, a table defined twice, a bad escape or an integer too large for 64 bits are all reported with the line number, as the specification requires.