JSON to INI converter

Useful for Windows, PHP and Python programs that read .ini files. Every object at the first level becomes a section.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter json text.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

First-level plain values go at the top of the file and every first-level object becomes a [name] section. Anything deeper becomes a dotted key such as nested.key, and list items become numbered keys like list.0. Values that are empty, contain ; or #, have edge spaces or look like numbers are quoted.

Example

Result: INI: app = toolsahla version = 2.1.0 port = 8080 debug = false languages.0 = ar languages.1 = en [database] host = localhost user = admin timeout = 30 ; Sections: 1.

{
  "app": "toolsahla",
  "version": "2.1.0",
  "port": 8080,
  "debug": false,
  "languages": ["ar", "en"],
  "database": {
    "host": "localhost",
    "user": "admin",
    "timeout": 30
  }
}
app = toolsahla
version = 2.1.0
port = 8080
debug = false
languages.0 = ar
languages.1 = en

[database]
host = localhost
user = admin
timeout = 30

Limits and caveats

  • INI has no single standard; the tool writes the most common form.
  • Multi-line values are not allowed and give an error.
  • null is written as an empty value.

Questions about this tool

What happens to nested objects inside a section?

They become dotted keys such as db.pool.size = 5, because INI supports only one level of sections.

Why is "42" in quotes?

It is a string in the JSON, and quoting stops readers that auto-convert numbers from treating it as one.

Can Python configparser read the output?

Yes, though configparser returns every value as text and keeps the quotes as they are.