Developer / Config

INI to JSON Converter (and JSON to INI)

Convert an INI configuration file to JSON, with sections as objects, dotted sections as nested objects, key[] lines as arrays, and numbers and booleans as JSON types, or turn a JSON object back into INI.

INI to JSON Converter (and JSON to INI): Each [section] header starts an object, and [database.replica] puts an object inside [database]. Lines are key = value or key: value; ; and # start comments, quoted values keep their spaces, and key[] = value lines build an array. Going back, plain values are written first and each object becomes a section. Runs 100% locally in your browser with zero server file uploads.

Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
INI to JSON converterLocal processing

Runs entirely in your browser

JSON

{
  "name": "Demo app",
  "debug": false,
  "database": {
    "host": "localhost",
    "port": 5432,
    "replica": {
      "host": "replica.local"
    }
  },
  "features": {
    "flags": [
      "search",
      "export"
    ]
  }
}

Sections become objects, and a dotted section such as [database.replica] becomes an object inside another. Comments start with ; or #, and a comment after a value needs a space before it, so URLs keep their #. key[] = value lines collect into an array. INI has no single standard: PHP, Python, and Windows each read some details differently, so check quoting and escapes against the program that will read the file.

Example

[database] with host = localhost and port = 5432 becomes {"database": {"host": "localhost", "port": 5432}}. A following [database.replica] with host = replica.local adds "replica": {"host": "replica.local"} inside database.

Dialects

INI was never standardised. PHP's parse_ini_file turns key[] lines into arrays, Python's configparser keeps every value as text and supports ${var} interpolation, and Windows .ini files are read by GetPrivateProfileString with no nesting at all. For environment files, use the .env to JSON converter.

How to use it

  1. Choose INI to JSON or JSON to INI.
  2. Paste the file.
  3. Copy the result, or swap it back in to convert the other way.

Privacy & limitations

Converted in your browser; the file is not uploaded.

Related tools

Frequently asked questions

Are numbers and booleans converted?

By default 5432 becomes a number and true, yes, and on become true; untick the option to keep every value as a string, as Python's configparser does.

What happens to comments?

They are dropped, since JSON has no comments. A comment after a value needs a space before ; or #, so URLs with # stay whole.

Can JSON arrays of objects become INI?

Only as JSON text inside the INI value; INI itself has no structure for them.

Free tool · runs in your browser · no account required