1001Ferramentas
📄 Converters

INI to TOML Converter

Converts an INI file (with [section] headers and key=value) to TOML — close formats with minor adjustments.

From INI to TOML

INI and TOML look alike at first glance: both use bracketed sections and key-value pairs. The difference lies in what the format guarantees. INI never had a specification — every implementation decides whether a semicolon starts a comment, whether values may be quoted, whether sections can nest. TOML pinned all of that down, with explicit types and defined escaping rules.

Paste the INI and receive TOML. Sections are kept, comments starting with a semicolon or hash become hash comments, the only kind TOML accepts, and values gain types: numbers stay numbers, booleans are normalised to lowercase, and everything else becomes quoted text with internal quotes escaped. A line that is neither comment, section nor key-value pair comes out commented, so you can see what needed attention.

What this surface conversion does not do is nesting. In TOML, a section whose name contains a dot represents real hierarchy — while in INI the same name is just a name with a dot in it. The literal translation preserves the text, but the meaning becomes something else at the destination; worth reviewing whenever the source INI uses dots in section names.

Frequently asked questions

Does TOML accept semicolons as comments?
No. Only the hash. A file with semicolon comments produces a syntax error in a TOML parser — and it is one of the most common failures for people who simply rename a .ini file to .toml.
Why do values gain quotes?
Because in TOML every string needs quotes: an unquoted value is only valid if it is a number, boolean, date or time. INI accepts bare text, so the conversion has to add the quotes — and escape any already inside the value.
Does it work for Git or PHP config files?
.gitconfig and php.ini carry syntax beyond basic INI — Git uses a quoted subsection inside the brackets, PHP has directives with their own syntax. For those, treat the result as a starting point and check the commented lines.

Related Tools