INI Formatter
INI Syntax Reference
; This is a comment (semicolon)
# This is also a comment (hash)
[section_name]
key = value
another_key = another value
quoted = "value with spaces"
empty =
[database]
host = 127.0.0.1
port = 5432
user = admin
password = secret
[section.subsection] ; dotted subsection (some parsers)
key = value
INI Format Rules
| Element | Syntax | Notes |
|---|---|---|
| Section | [section_name] | Case-sensitive in most parsers; must be on its own line |
| Key-Value | key = value | Whitespace around = is usually trimmed |
| Comment | ; comment or # comment | Must be on its own line (not inline, in most parsers) |
| Empty value | key = | Valid; results in empty string |
| Global keys | key = value (before any section) | Some parsers support a default/global section |
| Multi-line | Backslash continuation: value = long\ | Not universally supported |