Monitoring
Solutions
Resources
Free Tools
Pricing
Free Tools / Converters / INI to JSON Converter

INI to JSON Converter

Paste an INI file — php.ini, my.cnf, a .gitconfig, a desktop app's settings — and get JSON. Sections become objects, keys become properties, comments are left behind.

Runs entirely in your browser — nothing you enter here is sent to a server.

The INI format, such as it is

INI files are the oldest configuration format still in everyday use: lines of key = value, grouped under [section] headings, with comments starting with a semicolon or a hash. PHP, MySQL, Git, systemd units, Python's configparser and countless desktop applications read some dialect of it. There is no formal standard, which is exactly why converting to JSON helps — JSON has one unambiguous structure that every language can parse.

Sections become objects

[server] opens an object named server. Keys before the first section sit at the top level.

Dotted sections nest

[alerts.email] becomes {"alerts": {"email": {…}}}, the usual way INI files express a hierarchy.

Repeated keys become arrays

PHP-style key[] = value, or the same key given twice, collects the values into an array.

Values

Quoted values are kept as strings. Unquoted ones are typed when detection is on: 8443 is a number, true a boolean. Trailing comments are removed.

Why convert it

The usual reasons are practical. You want to read settings from a legacy application in a script that speaks JSON. You are moving an old service to a platform configured through environment variables or a JSON document. Or you need to compare two configurations — once both are JSON, sorted and formatted the same way, a diff shows exactly which values differ. Both = and : are accepted as the separator, so most dialects convert without editing.

Frequently asked questions

What is an INI file?

A plain-text configuration file made of key = value lines, optionally grouped under [section] headings. The name comes from the .ini extension Windows used for "initialisation" files.

Are comments converted?

No. Lines starting with ; or # are skipped, and a comment after an unquoted value is removed. JSON has no comments, so they cannot be carried over.

How are numbers and booleans handled?

With type detection on, unquoted numbers, true/false and null are converted to JSON types. Turn it off to keep every value as a string, exactly as written.

Does it support nested sections?

Section names containing dots, such as [database.replica], are converted to nested objects.

Related free tools

A calculator answers once. Monitoring answers every minute.

Upzilla checks your sites, servers and APIs around the clock and alerts you the moment something breaks. 10 monitors free, no card required.

Start monitoring free →