INI to JSON Converter

Convert INI to JSON and back — each [section] becomes a nested object, optional type parsing turns port=5432 into a number, and ; or # comments are stripped.

Turn INI config into JSON in your browser

Paste any INI-style configuration and instantly get a JSON object. Each [section] header becomes a nested object, and every key=value line inside it becomes a property — a string by default, or a real number, boolean or null if you turn on type parsing (so port=5432 becomes 5432 and enabled=true becomes true). Keys written before the first section stay at the top level, so simple flat configs convert just as cleanly as grouped ones. The output updates live as you type, so you can copy well-formatted JSON with a single click, indented by two spaces (the default), four spaces or a tab, which this browser keeps until you press Forget saved settings. JSON → INI goes the other way: plain values are written first and each object becomes a [section], and anything INI cannot hold, such as a list or an object inside a section, is refused by name rather than flattened.

Comments and whitespace handled for you

Lines starting with ; or # are treated as comments and skipped, a comment may also trail a section header ([db] ; database opens the section db), and blank lines are ignored. Section names, keys, and values are all trimmed, so stray spaces around the equals sign never end up in your data. Only the first = on a line splits the pair, which means values that themselves contain an equals sign — tokens, connection strings, base64 — are preserved exactly.

Frequently asked questions

How are INI sections converted to JSON?

Each [section] header becomes a nested object keyed by the section name, and the key=value lines below it become properties of that object — strings by default, or real numbers, booleans and null when type parsing is enabled. For example [db] with host=localhost becomes {"db":{"host":"localhost"}}.

What happens to comments and keys before the first section?

Lines starting with ; or # are ignored as comments, along with blank lines. Any key=value pairs that appear before the first [section] header are placed at the top level of the JSON object.

Can it turn JSON back into INI?

Yes. Switch to JSON → INI and paste a JSON object; comments and trailing commas are accepted, and a broken one is placed by line and column. Plain values become key = value lines at the top, each object a [section], and the download is an .ini file. What INI cannot hold, or would read back differently, is refused by name: a list, an object inside a section, a key that holds = or a line break or starts with ; # or [, a value with a line break or a space at either end. So the INI, read back with Parse numbers & booleans ticked, gives the same values.