Skip to content

INI ⇄ JSON converter

Convert INI config files to JSON and back, right in your browser.

Input
Output

INI ⇄ JSON converter

Paste an INI configuration file and get a clean JSON object back, or paste JSON and get INI. The converter runs both ways, so it fits whether you are reading a legacy config into a modern app or writing one out for a tool that still expects the classic key=value format. Typical jobs: turning a php.ini or a desktop app's settings file into JSON for a script, inspecting a config as structured data, or generating an INI section from an object you already have.

The INI side handles the format as it appears in the wild. Section headers in square brackets become nested objects, and any key=value pairs before the first section stay on the root. Comments starting with a semicolon or a hash are ignored, and whitespace around keys and values is trimmed. Values are deliberately kept as strings rather than guessed into numbers or booleans, so a version like 007 or a port written with a leading zero survives the round trip unchanged. An equals sign inside a value is left alone — only the first one splits the line.

Going the other way, scalar properties on the root object become top-level key=value lines and nested objects become their own [section] blocks. Arrays and deeper nesting have no place in flat INI, so they are skipped rather than written as broken markup. Turn "Pretty-print JSON" off for a compact single-line result, or leave it on for two-space indentation you can read.

Everything runs locally in your browser. Your configuration never leaves the page, which matters when the file holds database credentials, API keys or internal hostnames. Invalid JSON is reported calmly instead of a blank output, so you can find the missing comma or bracket and try again.

FAQ

How are INI sections mapped to JSON?
Each [section] header becomes a nested object, and the key=value pairs under it become that object's properties. Keys that appear before any section header stay on the root object.
Why are all the values strings?
INI carries no types, and guessing them corrupts data — a port like 08080 or a version like 007 would lose its leading zero. Values are kept as strings so the conversion is lossless; cast the fields you know are numeric in your own code.
What happens to comments?
Lines starting with ; or # are treated as comments and dropped. INI has no way to attach a comment to a value, so they cannot be preserved on the round trip back from JSON.
Can it convert nested JSON to INI?
One level of nesting maps cleanly: root scalars become top-level lines and objects become sections. Arrays and objects nested deeper than a section have no INI equivalent, so they are skipped rather than written as invalid text.
Is my config uploaded anywhere?
No. The conversion runs entirely in your browser and your INI or JSON never leaves your device — safe for files that hold credentials or internal settings.