Skip to content
AZ Tools

INI ↔ JSON Converter

Round-trip between INI-style config files and JSON — supports sections, dotted nesting, comments, and value type inference.

Output

Dotted section names like [server.tls] become nested objects. Quoted values stay strings; bare numbers/booleans/null are inferred.

How to use

  1. Pick a direction (INI → JSON or JSON → INI).
  2. Paste your config on the left.
  3. Copy the result on the right. Switching direction feeds the current output back as input.

About this tool

Show

Converts in both directions. Reading INI, it walks the file section by section, turns a dotted section name like [db.primary] into nested objects, keeps quoted strings exactly as written, and infers true, false, null, integers and floats from unquoted values. Indented continuation lines are folded into the value above them, the way configparser reads them. Writing INI, it emits the top-level scalars first as an un-sectioned head, then each nested object as its own [section], flattening anything deeper with dotted names.

INI has no specification, which is the root of every surprise in this format. This parser splits on the first = only, so the key: value dialect that Python's configparser also accepts will not be recognised here. Comments introduced by ; or # are read and discarded — they are not carried through to the output, so a round trip through this tool strips the documentation out of a config file. Duplicate keys in the same section resolve last-wins, and a section name that collides with an existing scalar replaces it.

Type inference is convenient and occasionally lossy, so it is worth knowing exactly where. A version written as 1.20 becomes the number 1.2 and loses its trailing zero. A zero-padded value like 007 becomes 7. An integer too large for JavaScript to hold exactly is left as a string rather than silently rounded, which is the one case where the tool refuses to guess. Anything with two dots, a leading +, or a hex 0x prefix stays a string, so 1.2.3 and +82101234567 survive unchanged. If you need a value to stay text, quote it.

JSON has arrays and INI does not, and no amount of convention fixes that. An array value is written out as its JSON form on a single line, which is readable and stable but does not come back as an array — reading that file again yields the string ["a","b"]. Multi-line strings do round-trip, written the way configparser writes them, with the first line after the = and the rest indented. If your data is genuinely a tree with lists in it, INI is the wrong destination and the conversion is telling you so.

Frequently asked questions

Why was my unquoted value turned into a number?

INI has no native types, so the parser infers them: bare integers, floats, true/false, and null are converted. Wrap the value in "..." to keep it a string.

Are comments preserved when going back to INI?

No. JSON has no comment construct, so anything you read in is dropped before the round-trip back. Add comments by hand after exporting.

The same key appears twice in my INI and one value disappeared. Why?

A JSON object cannot hold two identical keys, so the conversion has to choose, and the last occurrence wins here. Some INI dialects deliberately repeat a key to express a list; those sections need converting by hand into an array, because nothing in the INI text says whether a repeat means a list or a mistake.

Which INI dialect does this follow?

There is no specification for INI, only conventions. This follows the common Windows-style one: [section] headers, key=value, semicolon or hash comments, and dotted section names for nesting. Dialects that separate with a colon, use indentation for structure, or allow values continued over several lines will not round-trip unchanged.

Related tools