Skip to content

Developers

INI JSON Converter

INI JSON Converter

Beta

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 via API
  • Free, no sign-up
  • REST + MCP
  • Updated
  • Reviewed by Olgun Ozoktas

The config is converted in your browser and is not uploaded to FindUtils. Analytics and ads may load on the page.

INI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
JSON

The JSON will appear here..

How to convert an INI file to JSON

  1. Paste or upload the file

    Paste the INI text into the left panel or upload a .ini, .cfg or .conf file. The samples are a php.ini excerpt, a git config and a Windows-style app.cfg.
  2. Read the sections

    Every [section] becomes a nested object and any keys above the first header sit on the root. Comments opened by ; or # are dropped, and a quoted value keeps the spaces and punctuation inside the quotes.
  3. Decide on types

    Values stay strings by default, which is what most INI readers return. Turn on Numbers and booleans to promote 8080 and true when a schema expects them. Values with leading zeros stay strings.
  4. Copy or download

    Copy the JSON or download converted.json. Switch the direction to write [section] blocks back from a JSON object; the current output moves into the input for a round-trip check.

Common Use Cases

Feeding a JSON-only tool

Schema validators, diff viewers and dashboards read JSON. Convert the INI once instead of writing a parser for a format with no specification.

Reviewing a legacy config

A php.ini or a long .cfg is easier to read as a tree, where each section is one object and the root keys are visible at a glance.

Generating an INI from JSON

A build script or a settings screen produces JSON; the converter writes the [section] blocks and quotes the values that would not survive a re-read.

Finding duplicate keys

Most INI readers keep the last value silently. The duplicate report names the key and every line it appeared on.

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.

There is no INI standard. Every program that reads one invented its own rules, which is why a converter has to say exactly which rules it follows. FindUtils' INI JSON Converter implements the common ground that php.ini, git-style configs, Windows .cfg files and Python configparser actually agree on: [section] headers, key = value and key: value, comments opened by ; or # at the start of a line or after whitespace, and quoted values that keep whatever sits inside the quotes.

Each section becomes a nested object and keys above the first header stay on the root, so the JSON mirrors the file's shape rather than a guess at it. Values stay strings because that is what an INI reader hands back, with an option to promote clean numbers and booleans. A duplicate key keeps the last value, the way most readers do, and every duplicate is reported with the lines it appeared on instead of disappearing.

The reverse direction writes one level of sections and refuses deeper nesting or arrays with a plain message, because there is no array syntax every INI parser accepts and inventing one would produce a file that silently fails elsewhere. For dotenv files use the Env JSON Converter, for Java .properties the Properties JSON Converter, and for TOML the JSON TOML Converter.

How it compares

Most online INI converters split each line at the first equals sign. That is enough for a simple file and wrong for a real one: an inline comment ends up inside the value, a quoted string loses its spaces, and a duplicate key vanishes without a word. This page reports what it changed and refuses what it cannot express instead of guessing.

Compared with a Python one-liner using configparser, the page needs no interpreter and shows the nested shape immediately. It is not a substitute for a program's own reader: interpolation such as %(name)s, multi-line continuations and vendor-specific escapes are left as written.

INI Conversion Tips

  • A ; or a # only opens a comment when it starts the line or follows whitespace. A # in the middle of a word is part of the value.
  • Quote a value to keep a semicolon, a hash or leading and trailing spaces. Everything after the closing quote is treated as a comment.
  • Section names are kept exactly as written. A header such as [a.b] becomes one key named "a.b" rather than a two-level tree, so a round trip returns the same file.
  • Leave Numbers and booleans off when the values are read back as text. On is a string in every INI dialect, and turning 007 into 7 would change an id.
  • Going back to INI accepts one level of sections. A value nested two levels deep, or an array, is refused with a message rather than written in a syntax only some parsers accept.

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.

Rate This Tool

0/1000

Get Weekly Tools

Suggest a Tool