What is an INI to JSON converter?
An INI to JSON converter turns a legacy INI config file into JSON, and back again. INI is the old format — sections in square brackets, one key = value per line — used by Windows programs, PHP, and game configs for decades. JSON is the format modern tools expect. The default INI here has 2 sections and 4 keys, and converts to a JSON object with the same structure.
The need comes up during migrations. An old application stores its settings in app.ini, and the new version reads settings.json. Rewriting the file by hand is slow and error-prone, especially when the file has dozens of sections. A converter does it in a second, and the reverse direction lets you go back when an old tool still needs INI.
This tool is pure JavaScript and runs entirely in your browser. Nothing is uploaded, nothing is stored, and there is no account to create. Paste the config, pick the direction, and copy the result.
How INI to JSON conversion works
INI has two ideas: sections and keys. A line like [server] starts a section, and the lines under it — host = localhost, port = 8080 — are keys in that section. In JSON, the section becomes a nested object: "server" maps to an object with host, port, and debug inside it. The default file has 2 sections, server and database, and 4 keys in total.
Values are typed automatically. "8080" becomes the number 8080, "true" becomes the boolean true, and "localhost" stays a string. That matters, because a program reading the JSON expects a number for a port, not the string "8080". Quoted values stay strings, so "8080" in quotes is kept as a string on purpose.
Comments are skipped: lines starting with ; or # are ignored, which is the INI convention. Blank lines are skipped too. The reverse direction is the mirror image: a nested object becomes a [section], and top-level keys become plain key = value lines before the first section.
Sections and keys, explained
A section groups related settings. The default file has a server section for connection settings and a database section for the database name. That grouping is the whole point of INI: without sections, a file with fifty keys is a flat list nobody can navigate.
Keys inside a section are simple names — host, port, debug, name. The same key name can appear in two sections with different values, which is why sections exist: server port 8080 and database port 5432 would collide in a flat file, but in sections they are separate.
JSON keeps that structure as nesting, which is why the conversion is lossless for ordinary configs. The only things lost are comments and blank lines, which carry no data. If your INI file has comments worth keeping, copy them into the JSON by hand — no converter preserves them, because JSON has no comments.
Sections are the part of INI that maps most naturally to JSON, because a section is already a named group of keys. The converter turns each section into a nested object with the section name as the key, so a [database] section becomes a database object that holds host, port, and name. Keys before the first section have no section to belong to, so they sit at the top level of the JSON object. That mapping is what makes the output easy to use: the structure of the JSON mirrors the structure of the INI, and nothing is lost in the move.
A worked example: migrating a config
Take the default INI: [server] with host localhost, port 8080, and debug true, then [database] with name appdb. That is 2 sections and 4 keys. Convert it and you get a JSON object with a server object inside — host "localhost", port 8080 as a number, debug true as a boolean — and a database object with name "appdb".
Now reverse it. Paste that JSON back, switch the direction to JSON to INI, and you get the INI file again: [server], the three keys, a blank line, then [database] and its key. The round trip is exact for values, which is the test of a good converter — convert there and back, and nothing changes.
Try an error to see the boundary: an INI line with no equals sign, such as "just a line", fails with the line number, and the status changes to Invalid. The tool reports the problem rather than guessing, because a guessed conversion of a config file is worse than no conversion at all.
Who uses an INI to JSON converter, and why
Developers migrating old applications are the main users. A Windows desktop app, a PHP site, or a game server that has stored settings in INI for years needs those settings in JSON for the new version. Converting by hand takes an afternoon for a large file; the converter takes a second.
System administrators are the second group. A server fleet with INI configs and a new deployment tool that reads JSON needs the same conversion at scale, one file at a time. The converter handles one file per paste, which suits the careful, file-by-file pace of a migration.
Hobbyists and modders are a third group. Game configs, emulator settings, and mod files are often INI, and a player who wants to edit them with a JSON tool — or generate them from a script — needs the bridge. A YAML to JSON converter covers the same need for YAML configs.
System administrators are a third group. A server that has run for years accumulates INI files from tools that were installed and forgotten, and a migration to a JSON-based config means converting each one. The converter is the fast part of that job — the slow part is reading the converted JSON and checking that the values still mean what they meant in INI, because a port number that was a string in INI becomes a number in JSON, and a program that expected a string will need to be told.
INI to JSON vs other converters
INI is the oldest of the config formats on this site, and the simplest. A YAML to JSON converter handles YAML, which supports lists and deeper nesting than INI ever could, while a JSON formatter tidies JSON that is already JSON. Use this tool when the source is INI; the others cover the rest.
The key difference is nesting. INI has exactly two levels — sections and keys — while JSON and YAML nest without limit. A JSON object three levels deep cannot become INI without flattening, because INI has nowhere to put the third level. The converter handles the two-level case exactly and reports anything deeper as a flat key, which is the honest limit of the format.
All three converters share the same design: paste, convert, copy, with the data never leaving the browser. A JSON to YAML converter moves JSON the other way, into YAML, when the target format is YAML rather than INI. If your config is already JSON and only needs tidying, the formatter is the faster tool; if it is INI and needs to become JSON, this is the one.
Common INI conversion mistakes
The first mistake is expecting comments to survive. INI comments start with ; or #, and JSON has no comments at all, so they are dropped in conversion. If a comment explains why a value is set, move that explanation into your documentation before converting.
Second: values that look like numbers but are not. A version string such as "1.10" converts to the number 1.1, which is a different value. Quote values that must stay strings, or fix them after conversion — the converter follows the same rule as every other INI parser, and the rule is the trap.
Third: duplicate keys in one section. INI allows the same key twice, and most parsers keep the last value. The converter does the same, so a file with host set twice will keep only the second value. Check for duplicates before converting a file you have not written yourself.
Fourth: converting a file with deep nesting. A JSON object with objects inside objects has no INI equivalent, and the converter flattens what it can. If your JSON is deeply nested, JSON is the right format for it — do not force it into INI.
A second mistake is assuming that a key can appear twice in the same section. INI has no rule against duplicate keys, and some files repeat a key to mean a list, but JSON objects cannot hold two values under one key, so the converter keeps the last one and drops the earlier ones. If the original file relied on duplicates, the JSON will be missing data, and the only honest fix is to change the INI first — turn the repeated key into a list, or give each value its own key — before converting.
How to use this INI to JSON converter
Paste your INI into the box — the default has 2 sections and 4 keys — and pick the direction. INI to JSON is the default. The converted output appears instantly in the box below, with the section and key counts above it.
To convert the other way, paste JSON and switch the direction to JSON to INI. To copy the result, use the Copy button next to the output box. If the input has an error, the output names the line — fix it and paste again.
Everything runs in your browser. No sign-up, no account, no data sent anywhere — your config never leaves your device. It works offline once the page has loaded, so you can convert configs on a server with no internet access.
Paste the INI, press convert, and read the JSON before you copy it. The output shows a count of sections and keys, and that count should match the input — if the INI had three sections and the count says two, one of the section headers was misspelt and its keys landed in the wrong place. When the count matches, copy the JSON and paste it where the config belongs. If the JSON needs to go back to INI later, the reverse direction is a separate conversion, because the typed values the converter inferred cannot be un-inferred.