Cookies for analytics and advertising
We use cookies for analytics and advertising, both sent to Google. Refusing changes nothing you can see.Read the privacy page
Converting XML to INI flattens a document into key-value pairs: the root element becomes the section header and every level beneath it becomes part of a dotted key, with attributes marked by an @ and repeated elements numbered. It gets the values out of the tree, and it is an extraction rather than a translation.
Up to 100 files at once. Mixed formats are fine.
They convert one after another and download together as a ZIP.
XML to INI
The flattening builds a dotted path to every value in the document, then splits each path once: the part before the first dot becomes the section, the rest becomes the key. An XML document has one root element, so that first segment is the same for every value in the file, and the output is one section with a long list of dotted keys under it.
That is worth setting expectations about, because it is not what the same conversion does from YAML or JSON, where several top-level keys give you several sections. If you want a section per logical group, the practical route is to convert the fragments separately — one conversion per child of the root — rather than expecting the tool to pick which level deserves a header.
Take the standard .NET shape: a configuration root, an appSettings element, and inside it several add elements each carrying key and value attributes. The output is a section headed configuration, and inside it keys reading appSettings.add.0.@key set to Timeout and appSettings.add.0.@value set to 30, then the same pattern with index 1 for the next entry.
It is faithful and it is not pretty. The information you actually wanted — Timeout is 30 — is spread across two lines that are related only by their shared index. If the destination is a script, it is usually less work to read the two lines and write Timeout=30 yourself than to teach the consumer this shape. The conversion is most useful when the XML has real element names holding real values, and least useful on the key-value-attribute pattern .NET favours.
Every attribute becomes a key segment prefixed with @, so an element with an id attribute contributes a key ending @id. An element that carries both attributes and its own text stores that text under a segment named #text, since the attributes have already taken the element key.
Neither prefix is a standard INI convention, and no INI parser will treat them specially. They are there so that nothing collides — an attribute named value and a child element named value would otherwise write to the same key — and they are the first thing to strip if the file is being handed to a program rather than read. Renaming keys in the output is safe; the INI has no structure left to break.
Two or more siblings with the same tag become an array during parsing and pick up numeric segments: add.0, add.1, add.2, in document order. Order is preserved, which is the part that matters for a rule list or a search path.
A single occurrence gets no number, because the parser had no way to know the element repeats — one add element is just an object. So the same config with one entry and with two produces different key names, and a script matching on appSettings.add.0.@key finds nothing on the day the file has a single setting. Write the consumer to try both, or normalise the keys after converting.
Two things in the output describe the XML rather than your settings. A document that opens with a version and encoding declaration produces a section headed ?xml holding those values, and any namespace declaration on the root becomes a key such as @xmlns inside the main section. Neither means anything to an INI consumer.
Delete both. A section header containing a question mark is legal in the sense that INI has no specification to violate, and it will still confuse the next person and possibly the parser reading it. The encoding value is also worth ignoring rather than trusting: an attribute reading 1.0 is parsed as a number and comes out as 1, so the declaration in the output does not even say what the original said.
A licence block, an embedded script or a formatted description is one element holding several lines of text, and an INI entry is one line. Until 2026-08-09 the writer emitted those newlines as they were, so every line after the first sat in the file with no key in front of it — discarded on the way back if it held no equals sign, and worse if it did: a line reading like a bracketed header opened a section that was in no XML document, and the next real setting was read back inside it.
The writer now wraps such a value in quotes and writes each line break as a backslash and an n, so the element stays one entry and comes back intact through this converter. It is still worth knowing which elements in the XML hold multi-line text, because the program you are feeding may read the backslash literally. Where that program matters, put the block in its own file and let the INI carry the path to it.
More than you would expect. Values keep their semicolons, their slashes, their spaces and their embedded equals signs, because INI parsers split at the first equals sign only — so a connection string reading Server=db;Database=x survives as a single value and reads back correctly.
Element order is preserved throughout, and so is the relative position of attributes and children. Numeric-looking values are parsed on the way in, which is where the exceptions are: a version attribute written 1.0 becomes 1 and a zero-padded identifier written 007 becomes 7. Anything you were treating as an opaque token is worth checking in the output.
Comments are dropped, and on a settings file that is usually the most valuable text present. Namespaces stop meaning anything once the prefixes are just characters in a key name. The distinction between an attribute and a child element survives only as an @ in a string. Nothing in the INI can be validated, because INI has no schema language at all.
That is the honest summary of the direction: XML has been a W3C recommendation since 1998 and carries schemas, XPath, transformations and signatures; INI has been around since 1985 and carries nothing but lines. Converting one way loses all of it and there is no path back, so the XML original belongs in version control regardless of what happens to the INI.
A great many people arriving at this pair want a handful of settings, not a flattened document. If that is the case, read them out of the XML and type them into the INI file in the shape the consuming program expects. It takes minutes, the result is legible, and none of the artefacts above appear in it.
Use the converter when the file is large enough that reading it by hand is where the mistakes come from, or when you want a complete inventory of what a vendor config contains before deciding which parts matter. Both are good reasons. Converting an XML config wholesale and shipping the result as the new settings file is not.
| XML | INI | |
|---|---|---|
| Full name | Extensible Markup Language | INI Configuration |
| File extension | .xml | .ini, .cfg, .conf |
| Media type | application/xml | text/plain |
| First published | 1998 | 1985 |
| Published by | W3C | — |
| Specification | XML 1.0 | — |
| Licensing | Open standard | Open standard |
| Standing today | Current | Legacy, still read everywhere |
| Opens in a browser | Every browser | No browser |
| Considered instead | JSON, YAML | TOML, YAML |
Comments carry across. Both XML and INI have a comment syntax, so notes left for whoever maintains the file next are not silently thrown away.
No browser reads INI. It is the less portable of the two, so it is worth being sure the program at the other end accepts it before sending one.
Visual Studio Code reads both XML and INI, so there is a way to check the result against the original without a second tool.
The two are aimed at different work: XML at moving data between programs, INI at editing. That is worth weighing before converting, because the reason one exists is usually the reason the other is awkward.
XML is W3C's format, published in 1998. The specification is XML 1.0, and it is worth reading if the file has to outlive the tool that wrote it.
INI dates from 1985. Notepad and Visual Studio Code all read it.
No. This conversion runs entirely inside your browser, so the file never leaves your device. You can confirm it yourself: open the network tab of your browser's developer tools and convert something. You will see the page load, plus the analytics and advertising the site is paid for with — and nothing carrying your file.
Because the section name comes from the first level of the path and an XML document has exactly one root element. A file whose root is configuration produces one section headed configuration, with every level below it flattened into dotted keys.
As part of the key, with an @ in front of the attribute name. An add element carrying key and value attributes produces keys ending in @key and @value. Element text on a tag that also has attributes appears under a key ending in #text.
They are numbered, so two add elements produce keys containing add.0 and add.1 in order. A single add element gets no number at all, which means the key names change depending on how many entries the file had.
The XML declaration. A leading version and encoding line is parsed as a node named ?xml and flattened like any other, so it becomes a section of its own. Delete it — it describes the source file, not your settings.
Yes. Semicolons, brackets and further equals signs are written as they are and come back intact, because INI parsers split on the first equals sign and read a comment marker only at the start of a line. A line break is the one character that cannot be written as it is: it is escaped as a backslash and an n inside a quoted value, so nothing is lost, but a parser that does not read escapes will see those two characters.
No. The XML parser and the INI writer both run in this page, so a config holding credentials stays on your machine.