INI to JSON

Turn classic INI config into JSON without uploading the file. Paste a php.ini-style or desktop-app settings file: bracketed sections such as [database] become JSON objects, and each key = value line becomes a property inside that object. Choose 2- or 4-space indent, then copy or download the result. Values stay strings, the way most INI parsers treat unquoted text, so port = 5432 is the string "5432" rather than a number. Convert again in a typed pipeline if you need integers or booleans.

Comments that start with a semicolon or hash are omitted, and blank lines are skipped. A key repeated inside the same section keeps the last value, which matches typical INI readers and avoids silent arrays. Keys that appear before any [section] land at the top level of the JSON object. Dotted names such as db.host are not split into nested objects; the dot remains part of the key so you do not lose the original spelling.

Use this page when you are moving an old config into an API payload, a package manifest, or a JSON-only tool. If the destination is Kubernetes, GitHub Actions, or another YAML file, use INI to YAML instead and keep the same section structure in a format those tools already accept. After conversion, JSON Formatter can re-indent or sort keys. The whole step stays in your browser, so database passwords and internal hostnames in the INI never leave the device.

Input
Paste or type your content here…
Output
Your result will appear here

Frequently Asked Questions

How are INI sections turned into JSON?
Each [section] becomes an object key. Keys under that header become properties of that object. Lines before the first section, if any, are grouped at the top level. Nested dots in key names stay literal strings; this converter does not split host.name into nested objects.
What happens to comments and blank lines?
Lines starting with ; or # are comments and are dropped. Blank lines are ignored. Only section headers and key = value pairs appear in the JSON.
Which value wins if a key is repeated?
A later key in the same section overwrites the earlier one, matching how most INI readers behave. If you need every occurrence, rename the duplicates in the source before converting.
Should I use INI to YAML instead?
Use INI to JSON when the next step is an API, package.json-style config, or a JSON formatter. Use INI to YAML when the destination is a Kubernetes manifest, GitHub Actions file, or another YAML config. Both run locally; pick the format your consumer already parses.