Skip to main content
File & Data Conversion Tools

INI to JSON Converter

Convert INI configuration files to JSON - sections become nested objects, key-value pairs are preserved.

Paste your INI content below - this tool converts sections into nested JSON objects and preserves key-value pairs.

INI has no single universal specification - this tool supports the common conventions (sections, key=value, # and ; comments) most INI files use.

How the Conversion Works

A [section] header becomes a nested object under that name; key=value pairs within it become that object's properties; anything before the first section header goes at the root of the JSON output.

How to Use It

  1. Paste your INI content.
  2. Click Convert.
  3. Copy or download the resulting JSON.

Handling Duplicate Keys

If the same key appears twice within one section, the later value overwrites the earlier one in the JSON output (matching how most INI parsers behave) - this tool doesn't silently merge or lose the section itself, just follows last-value-wins for the specific duplicated key.

Example

; app settings
debug = false

[database]
host = db.internal
port = 5432

[mail]
from = hello@example.com

converts to:

{
  "debug": "false",
  "database": {
    "host": "db.internal",
    "port": "5432"
  },
  "mail": {
    "from": "hello@example.com"
  }
}

INI has no data types, so values arrive as strings. Convert "5432" to a number in your code if you need one.

Where INI Files Appear

  • php.ini and PHP extension configs.
  • Python's configparser files, setup.cfg and tox.ini.
  • .editorconfig, .gitconfig, Windows desktop.ini and many older desktop apps.
  • MySQL's my.cnf and systemd-style option files.

Why Convert to JSON

JSON is easier to validate, diff and load from almost any language. Converting an INI file is a good first step when moving settings into a web app, an API or a newer config format such as YAML or TOML.

To go back, use JSON to INI. For other formats see JSON to YAML and JSON to TOML.

Frequently Asked Questions

Each [section] becomes a nested object, and key=value lines become properties of that object. Keys before the first section stay at the top level.

No. Lines starting with ; or # are comments and are not included in the JSON.

INI has no standard types, so treat values as text unless your application converts them.
Share this tool: