INI to JSON Converter
Paste an INI file to get JSON. Sections become objects, keys become properties. You can also convert JSON back to INI.
Runs entirely in your browser. Nothing you enter is sent or stored.
How to use
- Choose INI → JSON or JSON → INI.
- Paste your INI or JSON into the input box.
- Optionally lowercase names (iniparser-compatible) or convert numbers and true/false.
- Copy or download the result.
Parsing follows the rules of the C iniparser library: lines are trimmed, lines starting with # or ; are comments, [name] starts a section, and key = value sets a value. A value in "double" or 'single' quotes is taken as-is; an unquoted value ends at the first ; or #. A line ending with a backslash continues on the next line. Keys before the first section become top-level JSON properties.
Use cases & tips
Moving settings into a JSON-based tool
INI files still hold settings for PHP, Git, Windows programs and many older apps, while newer tools and APIs expect JSON. Paste the INI and each [section] becomes an object. For example, [server] followed by host = example.com and port = 8080 becomes {"server": {"host": "example.com", "port": "8080"}}. Lines that appear before the first section land at the top level. The example menu loads app settings, a .gitconfig and a php.ini excerpt, which is a quick way to see what the output looks like.
Strings, numbers and booleans
INI has no data types, so by default every value stays a string, which is why port comes out as "8080" in quotes. If the receiving program wants real numbers and booleans, turn on the conversion option: 8080 becomes a number, and true or false in any capitalization becomes a boolean. Only strict JSON number formats are converted, so a value with leading zeros or a version such as 2.1.0 stays text. Look through the result for IDs or codes that should stay strings.
Comments, quotes and long lines
A common trap is a value that contains a semicolon or a hash sign. Unquoted, it ends there: password = abc;def is read as abc. Put it in quotes, as in password = "abc;def", and everything inside is kept. Full-line comments start with ; or #, and a trailing backslash joins a line to the next, which is handy for long paths or lists. The quoted example in the placeholder text, path = "/a;b", shows the difference in one line.
Dialect differences and going back to INI
There is no single INI standard. Some programs allow nested sections, only treat ; as a comment or accept duplicate keys differently, so a file may behave differently elsewhere than it does here. This tool follows the iniparser rules, and a single bad line stops the whole conversion with the line numbers listed, rather than producing a half-correct result. In the other direction, JSON to INI supports one level of sections only, so nested objects and arrays are refused with an explanation.
Frequently asked questions
Are INI comments supported?
Yes. Lines starting with ; or # are skipped. An unquoted value also ends at ; or #, so put values that contain these characters in quotes.
Why are all my values strings?
INI has no data types, so values are kept as strings by default. Turn on number and true/false conversion to get JSON numbers and booleans.
What happens with a syntax error?
If any line is neither a comment, a section nor key = value, nothing is converted and the line number of each error is shown, just like iniparser refuses to load the file.