Skip to content

Menu

INI to JSON

Convert INI files to JSON

Runs entirely in your browserConvertersFree, no sign-up
Loading tool

01What is INI to JSON?

INI files never got a formal standard, yet they still turn up everywhere. You find them in php.ini, my.cnf, .gitconfig, Python's configparser files and old Windows settings. This converter reads that loose format and gives you structured JSON you can diff, validate or load from code. Here is how the parser works. It first joins lines that end in a backslash, so a long value can wrap across several lines. Windows CRLF endings are cleaned up at the same time. Then it walks the file line by line. Blank lines and lines starting with ; or # are skipped. A [section] header opens a new object, and a dotted header like [database.pool] becomes a pool object nested inside database. Repeating a header later in the file merges into the same object instead of replacing it. For each key line, the separator is the first = or :. There is one exception we added on purpose. A colon followed by // is treated as part of a URL, so url = https://example.com:8443/v1 keeps the whole address. Inline comments are cut when ; or # follows a space or tab, but never inside a quoted value. Booleans use the same words as Python's configparser getboolean, minus 1 and 0. true, yes and on become true, and false, no and off become false, in any letter case. Whole numbers and decimals become JSON numbers. An integer too large for JavaScript to hold exactly stays a string, so 9007199254740993 is not silently rounded. Quoted values lose their quotes and stay text. Everything else is a plain string. A quick worked example. Paste [api], then mode: "0755" ; perms, then big = 9007199254740993. You get {"api":{"mode":"0755","big":"9007199254740993"}}. The comment is gone, the quoted mode stays text, and the big integer is kept as a string. Section and key names like __proto__ or constructor are stored on objects with no prototype. A hostile file can't reach into the page's own JavaScript objects that way. The text you paste is parsed by script on this page, and the converter makes no network request with it. Some limits are worth knowing up front. PHP array syntax such as key[] = value is not expanded, and the key keeps its brackets. Dots inside key names are not split, only dots in section headers. Duplicate keys keep the last value. A continued line is joined to the previous one with a single space, and its leading indentation is dropped.

Backend developers and sysadmins who need to diff, migrate or script against php.ini, my.cnf, .gitconfig or configparser files. The tool runs entirely in your browser, so your data never leaves your device.

02How to use INI to JSON

  1. Paste your INI file into INI Input, or load the PHP, Git or Database example
  2. Choose 2 Spaces or 4 Spaces from the Indent dropdown
  3. Review the structured result in JSON Output
  4. Click Copy to grab the JSON, or Reset to clear everything

03Worked examples

Input: [database] host = localhost port = 5432 debug = true
Result: {"database":{"host":"localhost","port":5432,"debug":true}}
Numbers and booleans are converted to JSON types instead of staying strings.
Input: name = app ; inline comment [server.http] port=8080
Result: {"name":"app","server":{"http":{"port":8080}}}
Keys before any section go at the top level, and a dotted section name becomes nested objects.
Input: [paths] root = "/var/www" ratio = 1.50 flag = off
Result: {"paths":{"root":"/var/www","ratio":1.5,"flag":false}}
Quotes are stripped, 1.50 becomes 1.5, and off is read as false.
Input: [a] x = 1 [a] y = 2
Result: {"a":{"x":1,"y":2}}
A repeated section header merges into the same object.
Input: [api] url = https://example.com:8443/v1 mode: "0755" ; perms big = 9007199254740993
Result: {"api":{"url":"https://example.com:8443/v1","mode":"0755","big":"9007199254740993"}}
The :// in the URL is not mistaken for a separator, a colon works as a separator on the next line, and an integer beyond JavaScript's safe range stays a string.
Input: [cmd] run = npm install \ --production
Result: {"cmd":{"run":"npm install --production"}}
A trailing backslash joins the next line, with one space between the parts.

04Common use cases

  • Converting a php.ini from staging and from production to JSON, then diffing them to find the setting that differs
  • Moving a Python configparser file into a Node.js service that reads its config as JSON
  • Reading a .gitconfig or my.cnf into a script or jq pipeline that only understands JSON
  • Checking how values like On, 4096 or "0755" will be typed before you trust an automated migration
  • Loading INI-based game or desktop app settings into a web settings editor
  • Spotting a commented-out line or a stray duplicate key in a long config file, since the JSON shows only what is live

05Tips

  • Dots in key names stay literal, so date.timezone remains one key. Only section headers create nesting.
  • Quote a value to keep it a string. "0755" stays text, while an unquoted 0755 becomes the number 755 and loses its octal meaning.
  • A setting that legitimately holds the word no or off becomes false. Quote it if you need the literal word.
  • An inline comment needs a space or tab before the ; or #. Without one, as in color=#fff, the # stays in the value.
  • IDs and big counters longer than 15 or 16 digits come out as strings on purpose, so check your consumer accepts that.

06Related concepts

INI file format, configuration files, type coercion, configparser, JSON.

Frequently Asked Questions

What is INI to JSON?

INI to JSON is a free, browser-based developer tool on AIDToolStack. Convert INI files to JSON It requires no installation or sign-up and works entirely in your browser.

Is INI to JSON free to use?

Yes. No sign-up, no fees and no usage cap.

Does INI to JSON store my data?

No. It runs in your browser; nothing is uploaded.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe