---
title: "INI JSON Converter"
description: "Convert INI, .cfg and .conf files to nested JSON and back in your browser. Each [section] becomes an object, comments are dropped, and values stay strings by default."
url: https://findutils.com/developers/ini-json-converter/
category: developers
---

# INI JSON Converter

Convert INI, .cfg and .conf files to nested JSON and back in your browser. Each [section] becomes an object, comments are dropped, and values stay strings by default.

**Use this tool:** [INI JSON Converter](https://findutils.com/developers/ini-json-converter/)

## Programmatic access

- REST id `ini-json-converter`: POST https://api.findutils.com/api/tools/ini-json-converter/execute (reference: https://findutils.com/api/ini-json-converter/)
- MCP tool `ini_json_converter` on https://mcp.findutils.com (reference: https://findutils.com/mcp/ini-json-converter/)

## Why convert INI to JSON in the browser?

INI is the oldest configuration format still in daily use, and it never had a standard. php.ini, git config, Windows .cfg files and Python setup.cfg all use [section] headers with key = value lines, and all of them disagree about the details: whether a colon separates a key, whether # opens a comment as well as ;, and what a quoted value means. Rewriting one of those files into nested JSON for a script, a schema check or a diff is minutes of careful retyping, and the file usually carries a hostname or a password that has no business in an upload form. This page reads the common ground those dialects share and writes JSON in the tab, and writes [section] blocks back from a JSON object.

## Frequently Asked Questions

### What happens to the keys above the first [section]?

They stay on the root of the JSON object, beside the section objects. That mirrors how INI readers treat them, as a default or global group that belongs to no section.

### Why are numbers quoted in the JSON?

Because an INI reader returns text. server port 8080 is the string "8080" to the program that reads it. Turn on Numbers and booleans to promote clean integers, decimals, true and false. Values with leading zeros stay strings because 007 is an id, not a number.

### How are comments handled?

A ; or a # that starts a line, or that follows whitespace, opens a comment and the rest of the line is dropped. Inside a quoted value both characters are kept. Comments are not carried into JSON and cannot come back on the return trip.

### What does it do with a duplicate key?

The last value wins, which is what most INI readers do, and the key is listed under Warnings with every line it appeared on. Duplicates are never collected into an array, because only some dialects read repeated keys that way.

### Does [database.primary] become a nested object?

No. The section name is kept literally as one key called "database.primary". Dialects disagree about whether a dot in a header means nesting, so treating it as text keeps a round trip exact.

### Why was my JSON refused when converting back to INI?

INI has one level of sections and no array syntax that every parser accepts. A value nested two levels deep, or an array, is refused with a message naming the key, so you can flatten it deliberately rather than receive a file that fails somewhere else.

### Is my config uploaded?

No. Parsing and writing happen in your browser and no request carries the text, which matters for a file holding a hostname or a password. Third-party analytics and ads may load on the page, as on the rest of the site.

### Does it read TOML or .properties?

No. TOML looks similar and is a different, specified format with typed values and arrays of tables. Java .properties has continuation lines and its own escapes. Use the JSON TOML Converter or the Properties JSON Converter for those.

### Can it read a systemd unit file?

Only in the loosest sense. Unit files use [Section] headers but allow repeated directives that are meaningful as a list, and this page keeps the last value. Treat the result as a reading aid, not a faithful representation of the unit.

### Are the quotes kept in the JSON value?

No. Quotes delimit the value and are removed, so "demo ; prod" becomes the string demo ; prod. On the way back a value is quoted again only when it needs it: leading or trailing spaces, or a ; or # that would otherwise start a comment.

## Related Tools

- [Properties JSON Converter](https://findutils.com/developers/properties-json-converter/)
- [Env JSON Converter](https://findutils.com/developers/env-json-converter/)
- [JSON TOML Converter](https://findutils.com/developers/json-toml-converter/)
- [JSON YAML Converter](https://findutils.com/developers/json-yaml-converter/)
- [JSON Formatter](https://findutils.com/developers/json-formatter/)
- [YAML Validator](https://findutils.com/developers/yaml-validator/)
