INI to JSON converter
Paste a .ini, .cfg or php.ini file to get structured JSON. You get a line-numbered message for a repeated key or a line without =.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter ini text, turn numbers and true/false into typed values, remove comments after values ( ; or # ) and indentation.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Lines starting with ; or # are comments. [name] starts a new section and each key = value or key: value line is added to it after trimming spaces and surrounding quotes. With typing on, true and false become booleans and text becomes a number only if written in canonical form, so 1.10 and 007 stay text.
Example
Inputs: Turn numbers and true/false into typed values = yes, Remove comments after values ( ; or # ) = no, Indentation = 2 spaces. Result: JSON: { "title": "My App", "database": { "host": "localhost", "port": 5432, "ssl": true }, "paths": { "logs": "/var/log/app" } }; Sections: 2.
; ToolSahla settings title = My App [database] host = localhost port = 5432 ssl = true [paths] logs = /var/log/app
{
"title": "My App",
"database": {
"host": "localhost",
"port": 5432,
"ssl": true
},
"paths": {
"logs": "/var/log/app"
}
}Limits and caveats
- Nested sections and line continuation are not supported; [a.b] stays a single name.
- A comment after a value is removed only when you turn the option on.
Questions about this tool
Why did 1.10 stay text?
Turning it into a number would drop the zero and give 1.1, which breaks version numbers. Values change type only when their text stays the same.
Where do keys before the first section go?
They sit at the top level of the JSON next to the sections.
Does it accept : instead of =?
Yes. The first = or : on the line separates the key from the value.
