Skip to main content
Home Tools INI Formatter
🔧 Programming ✅ 100% Free ⚡ Instant

INI File Formatter

Format and beautify INI configuration files. Normalises section headers, aligns key-value pairs, preserves comments, and removes duplicate blank lines. Works with .ini, .cfg, and .conf files.

Indent:
📥 Input
📤 Output
Ready — paste code and click Format · Ctrl+Enter to format
Lines: — Size: —
Load example: ▶ Config ▶ Php_ini
📊 Stats
Lines
Size
💡 Quick Reference
[ ]Section header
key=value
# comment
; comment
No quotes needed

What is the INI File Format?

INI (initialization) files are a simple configuration file format originating from early Windows software. They consist of sections (in square brackets), key-value pairs separated by = or :, and comments starting with # or ;. Despite being informal (no official specification), the format is widely used in Python's configparser, PHP's php.ini, Git's .gitconfig, and many Linux tools.

Frequently Asked Questions

No, there is no official INI specification. The format evolved organically from Windows 3.x configuration files. Different parsers handle edge cases differently — some allow multi-line values, some support quotes, some are case-sensitive for keys. Python's configparser, PHP's parse_ini_file(), and the ini npm package all have slightly different behaviours.
All three are configuration formats. INI is the simplest — flat key-value pairs with optional sections, but limited support for nested structures, arrays, or data types. TOML (Tom's Obvious Minimal Language) is like a structured, typed INI — it supports arrays, nested tables, and explicit data types. YAML is the most flexible but also the most complex and whitespace-sensitive. For modern projects, TOML or JSON are generally preferred over INI.
Standard INI does not support arrays or nested structures. Some parsers allow workarounds like duplicate keys (each representing an array element) or dotted key names for nesting (server.host = localhost). If you need complex structures, consider TOML or YAML instead.
Done!