INI to JSON Converter — Convert Configuration Files Online
INI to JSON Converter
Paste an INI file — php.ini, my.cnf, a Git or Python configparser file, a Windows .ini — and get the same settings as JSON. Conversion runs in your browser; nothing is uploaded.
How the conversion works
[section]headers become objects. Everykey = valueafter a header goes into that section's object.- Keys before the first section go at the top level of the JSON.
;and#lines are comments and are skipped, as are blank lines.- The value is everything after the first
=, trimmed — sourl = https://example.com/?a=bkeeps the full URL. - Values stay strings. INI has no types, so
port = 5432becomes"5432"andenabled = truebecomes"true"; convert them in your code as needed. Quotes around a value are kept as part of the string. - Lines without
=are ignored, and if a key repeats within a section the last value wins.
Example
; Application settings
name = demo
[database]
host = localhost
port = 5432
[cache]
enabled = truebecomes
{
"name": "demo",
"database": {
"host": "localhost",
"port": "5432"
},
"cache": {
"enabled": "true"
}
}When to convert INI to JSON
- Migrating configuration from an INI-based tool to one that reads JSON (or YAML — convert the JSON with JSON to YAML).
- Inspecting a large config in a JSON viewer: paste the output into the JSON Formatter for a collapsible tree.
- Comparing two config files structurally with JSON Diff, so key order and whitespace do not matter.
- Feeding settings to a script that already parses JSON.
INI dialects
INI is not one standard. This converter handles the common core — sections, key = value pairs and comments. Dialect-specific features are passed through as plain text: PHP's key[] = value arrays become a key literally named key[] (the last value wins), and line continuations or ${var} interpolation are not expanded.
Related tools
- JSON to PHP INI — the reverse direction
- INI to YAML
- TOML to JSON — for TOML, INI's typed successor