Paste an .ini, .cfg or .conf file and get structured JSON, or switch direction to write JSON as an INI file. Sections, comments, quoted values, arrays and number or boolean detection are all handled, and errors point to the exact line.
Last updated:
Everything runs in this tab; your config files are never uploaded. Drop a file on the input. Tip: Ctrl + Enter converts.
Advertisement
Advertisement
How to use the INI to JSON Converter
Choose the direction: INI → JSON or JSON → INI.
Paste your file, drop it on the input or press Open. A sample config is loaded to start.
Adjust parsing: type detection, nested sections, inline comments and duplicate keys (or array style and separator for INI output).
Check the result on the right. Errors show the line and a Show in input button.
Copy or download the output, or press Swap direction to convert it back.
INI syntax supported
INI
JSON result
name = Cabin
"name": "Cabin"
port = 8080
"port": 8080 (with type detection)
timeout: 30
"timeout": 30 (colon separator)
[server]
"server": { … }
[database.pool]
"database": { "pool": { … } }
host[] = a host[] = b
"host": ["a", "b"]
env[prod] = yes
"env": { "prod": "yes" }
msg = "Hi\nthere" ; note
"msg": "Hi\nthere"
pass = 'a;b#c'
"pass": "a;b#c"
flag (no =)
"flag": null
Where INI files are used
php.ini and other PHP configs, which also popularised the key[] array syntax.
Python setup.cfg, tox.ini and pytest.ini, read by the configparser module.
Windows desktop.ini and many older application settings files.
Git config, systemd unit files and MySQL my.cnf use the same section and key layout.
Moving a config to a newer format? Convert the JSON on to YAML with JSON to YAML, or handle environment files with the ENV to JSON converter.
Frequently asked questions
Is there an official INI standard?
No. INI is an informal format, and Windows, PHP, Python configparser, Git and others differ in details. This converter accepts the common superset: [sections], key = value or key: value, ; and # comments, quoted values, key[] arrays and backslash line continuation.
How are sections converted to JSON?
Each [section] becomes an object holding its keys. Keys that appear before the first section are placed at the top level. With Nest [a.b] sections on, [database.pool] becomes a pool object inside database; turn it off to keep "database.pool" as one key.
Are values converted to numbers and booleans?
With type detection on, unquoted values like 8080, 3.2, true, false and null become JSON numbers, booleans and null. Values with leading zeros, such as 02134, and any quoted value stay strings. yes/no/on/off are only converted if you tick that option, so a value like no (Norway) is not turned into false by accident.
How do I write an array in INI?
Repeat the key with empty brackets, like replica[] = host1 and replica[] = host2, which gives "replica": ["host1", "host2"]. Alternatively set Duplicate keys to Collect into array to turn repeated plain keys into arrays.
When is a ; or # treated as a comment?
A line starting with ; or # is always a comment. Inside a value, ; or # starts a comment only when it follows a space, so p@ss#1 stays intact. Put a value in quotes to keep a ; or # that follows a space, or turn off Strip inline comments.
How is JSON converted to INI?
Top-level plain values are written as global keys, objects become [sections], deeper objects become [parent.child] sections, and arrays of plain values become key[] lines or a comma list. Strings that would otherwise be read as numbers, booleans or comments are quoted so they convert back unchanged.
Is my file uploaded?
No. The INI parser and JSON writer run in JavaScript in this page, so passwords and keys in your config never leave your device.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.