Skip to content

INI to JSON

Convert an INI or config file into structured JSON, sections and all.

Quick Tool Overview

The INI to JSON converter turns sections into objects, nests dotted section names, keeps pre-section keys at the root, strips both comment styles and types the values — with typing switchable off.

What it does
Converts INI and .cfg files into JSON
You give it
php.ini, my.cnf, .gitconfig, a systemd unit
You get back
Structured JSON with sections as objects
Best for
Scripting against legacy config files
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the INI to JSON

INI is still everywhere — php.ini, my.cnf, tox.ini, .gitconfig, systemd units, Windows desktop entries — and nothing reads it natively any more. This converter turns one into JSON so a script, a template or a test can work with it.

Sections become objects, and a dotted section name such as [db.pool] nests rather than becoming a key with a dot in it. Keys written before the first section stay at the root. Comments beginning with either a semicolon or a hash are dropped, quoted values have their quotes removed, and values are typed: true, yes and on become booleans, numbers become numbers, and everything else stays a string. You can turn typing off when the consuming system wants strings throughout.

Key features of the INI to JSON

Dotted sections nest

A [db.pool] header becomes a pool object inside db, rather than a key with a dot in its name.

Both comment styles

Semicolon and hash comments are recognised, including trailing ones — but not inside a quoted value, where they are content.

Root keys preserved

Keys written before the first section stay at the top level, matching how every INI reader treats them.

Optional type detection

true, yes and on become booleans and numbers become numbers, or everything stays a string when the consumer expects that.

Quotes removed

A quoted value has its quotes stripped, so the JSON holds the value rather than the quoting.

How to use the INI to JSON

  1. 1

    Paste the INI file

    php.ini, my.cnf, a .gitconfig, a systemd unit or any key = value config.

  2. 2

    Choose how sections nest

    Dotted names such as [db.pool] can nest, or stay as one flat key.

  3. 3

    Choose type handling

    Type detection gives real booleans and numbers; turn it off to keep strings.

  4. 4

    Copy the JSON

    Formatted and ready to use in a script or a test fixture.

Frequently asked questions

Both. A line beginning with a semicolon or a hash is a comment, and a trailing comment after a value is stripped unless the value is quoted.

Reviews of the INI to JSON

What people who use the INI to JSON think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the INI to JSON. It takes half a minute and no account.

Write the first review

More developer tools