INI to JSON Converter

Paste an INI settings file and read each of its [sections] back as JSON, with every setting kept under the heading it was written under.

FluffyShield Protected workspace
FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

What happens when a file has the same [section] twice?

This converter joins the two parts into one section, in file order, and tells you it did.

From INI to JSON
  1. Read each line as a heading, a setting or a comment
  2. File every setting under the heading above it
  3. Write the sections out as a list, in file order

What it does

keep_versions is "30"

INI doesn't say whether 30 is a number or a word, so the JSON keeps it as text in quotes and leaves the deciding to the program that reads it.

A comma is just a comma

The line include = *.jpg, *.heic comes out as one piece of text. Nothing splits it into a list.

Paths look doubled

JSON uses the backslash as its own escape mark, so C:\Users\Ana\Pictures is written with each backslash twice. Read back, the path is the same.

Limits One INI style only: name = value or name: value lines. A name with no = or : after it stops the conversion.

A backup program's settings, with two lines added at the end

Photos from the family computer go to an external drive every night, and the backup program keeps its settings in a small text file called backup.ini. Inside, it's a list of name = value lines, sorted under headings in square brackets. Each heading starts a section, and a section holds every line below it until the next heading comes along.

The drive was filling up, and a help forum suggested keeping only the last 30 copies of each photo: "add these two lines to the end of backup.ini". The two lines were a [destination] heading and keep_versions = 30. Before trusting the change, you paste the file in here to see what it now says.

A heading holds the lines under it

The file has two lines that both start path =. That's fine: one sits under [source], where the photos are, and one under [destination], where the copies go. They are two different settings that happen to share a name, the way two people in different streets can both live at number 12.

The forum's lines are another matter. With its own heading, the setting lands in a second destination section, and now the file describes one section in two places:

backup.ini, with the added lines; Photo backup settings[source]path = C:\Users\Ana\Picturesinclude = *.jpg, *.heic[destination]path = E:\Backup\Picturesschedule = daily 02:00[destination]Joined: line 10keep_versions = 30The JSON"" (no name)no entries"source"path, include"destination"path, schedule, keep_versions

The same heading twice

Each path belongs to the heading above it, so the JSON keeps two of them. The repeated heading on line 10 is joined into the first. How we checked

A program could read that by joining the two parts, by keeping only the second, or by keeping only the first. INI has no single specification to say which is right, so programs differ. This converter joins them, in file order, and says so under the result: "Section "destination" appears more than once, so its entries were joined into one section." The second heading is on line 10.

Joined, the JSON holds three sections. The first has an empty name and no entries; it's where any settings above the first heading would go, and this file has none.

Moving the setting and reading the result

  1. Paste backup.ini, which ends with the keep_versions = 30 line under a second [destination], into the INI box.

  2. Read the sections on the Result tab on a phone, or in the JSON box beside the INI box on a computer.

  3. Under the result, the note says the second [destination] heading was joined into the first.

You'd rather keep the file as INI, with the move made

JSON formatter, with INI chosen

Choose INI under Language and Normalize under Do. Comments go, and each setting is written name=value with no spaces around the =.

The file has no [headings], and its names have dots in them, like app.name

.properties to JSON Converter

That's probably a Java .properties file, whose rules for spaces, colons and backslashes are different.

Search FluffyBench