INI File Format Guide
Reference for the INI configuration file format with sections, keys, values, and comments.
Structure
INI files organize settings into sections marked by [section] headers. Each section contains key=value pairs. Comments start with ; or # characters. Values may be quoted to preserve whitespace. The format is not formally standardized, leading to parser differences in multiline values, nesting, and type interpretation. Despite this, INI remains widely used for simple configuration.
- sections
- Bracketed headers
- key=value
- Settings pairs
- comments
- ; or # prefix
[database] port = 5432 ; comment Parser Differences
Some parsers support nested sections using dot notation or indentation. Multiline values may use continuation characters or indentation, but support varies. Type handling differs: some parsers return all values as strings, others infer types. Libraries like Python configparser and Node ini have different feature sets. For portability, avoid advanced features and keep values simple.
- nesting
- Varies by parser
- multiline
- Not universally supported
- types
- Often string-only
dot or indent continuation chars manual conversion