Move an INI config into JSON for a modern tool
Legacy app config lives in an INI file; the new service wants JSON. Convert sections to nested objects without retyping.
Tools used in this guide
The job
[database] host = localhost style files map to JSON cleanly — but dotted sections, repeated keys and value typing have rules worth knowing before the migration.
Convert, then check the shape
Paste the INI, run INI→JSON. [a.b] headers become nested objects; numbers and booleans are typed when they look like it (port = 5432 → 5432); repeated keys keep the last value.
- Comments (# / ;) don't survive — copy them into the JSON as _note fields if they matter.
- The reverse direction flattens nested objects into dotted section names.
Edge cases to eyeball
Quoted values lose their quotes (and inside "…" the escapes \" \\ \n \r \t are undone); a value that merely looks numeric becomes a number (version = 1.10 → 1.1 — quote it in the INI first if the string matters). Duplicate sections merge rather than error. In the →INI direction, keys that can't be expressed in INI (newlines, =, leading comment marks) are skipped and marked with a ; comment.