INI Parser

Parse and convert INI configuration files to JSON instantly. Supports sections, comments, and quoted values. All processing done in your browser.

Instant Parsing Section Support Client-Side Processing
Parsed JSON will appear here...

How to Use INI Parser

1

Paste INI

Enter or paste your INI configuration content into the input area.

2

Parse

Click the Parse button to convert your INI to JSON.

3

Copy JSON

Review the generated JSON output and copy it to your clipboard.

What is an INI File?

INI files are a simple text-based configuration file format commonly used on Windows and in many applications. They use a straightforward structure of sections, keys, and values that is easy for both humans and machines to read.

INI Structure

Sections

Denoted by [section_name] headers to group related settings

Key-Value Pairs

Simple key = value assignments within sections or globally

Comments

Lines starting with ; or # are treated as comments

Frequently Asked Questions

What INI features are supported?

This parser supports sections, key=value pairs, comments (using ; or #), quoted string values, and multiline values. It also handles boolean and numeric type detection.

Can I parse PHP-specific INI files?

This parser handles standard INI format. Some PHP-specific extensions like constant substitution and special operators may not be supported.

How are duplicate keys handled?

When duplicate keys are found in the same section, the last value takes precedence. This follows standard INI parsing behavior.

Where is the INI format actually used?

Classic homes: php.ini (the PHP engine's entire configuration), .gitconfig, the win.ini heritage on Windows, .desktop entries on Linux, and many games and desktop apps. The format's roots go back to the 1960s-70s, which is why syntax varies slightly everywhere - sections, key=value, and semicolon comments are the stable core.

Are INI values typed?

No - everything is a string; types are a consumer-side convention. PHP's parse_ini_file() casts true/on/yes/1 and false/off/no/0 to booleans (documented behavior), converts number-looking values to integers and floats, and keeps the rest as strings. Quoting a value ('1') preserves it as a string in PHP. This parser shows the raw values as written.

How do sections and nested keys work in INI files?

[section] starts a section that scopes all following keys until the next header - php.ini's [PHP] and [mail function] blocks work this way. Nesting is faked with dotted keys (database.host = localhost) or section names like [database.pool], since the format itself has only one level. Deeply nested data is a sign you have outgrown INI and want TOML or YAML.

How are special characters and escaping handled in INI?

The baseline format defines almost no escapes - values are taken literally up to end-of-line. In practice: double quotes group values containing spaces and are the only portable way to keep leading or trailing whitespace; ${VAR} interpolation exists in some implementations (systemd, for one) but not others; and whether ; and # start comments mid-line depends on the consuming parser.

What is the difference between INI and .env files?

.env is INI's flat subset: KEY=value lines, no sections, consumed by dotenv libraries in a dozen languages following the 12-Factor App configuration methodology. INI files lean on sections and are read by specific applications rather than a generic convention. Values in .env are almost always strings injected into environment variables, while INI consumers often apply their own typing rules.

{-- * External Resources Component(#18 Phase 3b 内容佐证工程) * 工具页「权威引用」区块:RFC / W3C / WHATWG / ECMA / IANA / 官方规范站 / Wikipedia。 * * - 接受 :slug 属性 → 经 config/tool-sources.php 家族矩阵渲染该工具的权威引用 * - slug 未命中映射时不渲染(无权威来源的工具静默跳过) * - 链接 title 保持英文(引用源专名);description 经 * common.resources.descriptions.{key} 本地化,lang 未命中回退英文(线上不裸奔) * - 链接保持 dofollow(rel="noopener noreferrer") * * @param string|null $slug --}}