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.
More File & Data Conversion Tools
View all 20INI 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
- Paste your INI content.
- Click Convert.
- 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.iniand PHP extension configs.- Python's
configparserfiles,setup.cfgandtox.ini. .editorconfig,.gitconfig, Windowsdesktop.iniand many older desktop apps.- MySQL's
my.cnfand 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
Explore More Tools
Keep going with related categories and our most used tools.