Docento.app
Laptop and notebook on a desk
All Posts

What Is an INI File? Format, Uses and How to Edit One

By The Docento.app TeamPublished 3 min read
Try Docento's free PDF editor — No sign-up, 100% private — sign, annotate, and stamp PDFs in your browser.Open the editor

INI files are among the oldest configuration formats still in use. The name comes from "initialization", and the pattern, settings grouped under bracketed section names, is familiar from decades of Windows software and has influenced many modern formats.

What an INI file looks like

; Display settings
[Display]
width=1280
height=720
fullscreen=false

[Audio]
volume=75
device="Speakers (High Definition Audio)"
  • A line in square brackets starts a section.
  • Each key=value line below it is a setting in that section.
  • Lines starting with ; (and in many programs #) are comments.

That is essentially the entire format.

A convention, not a standard

There is no formal INI specification. Microsoft popularised the format for Windows configuration files, such as win.ini and system.ini in older versions, and the Windows API has functions for reading and writing INI files. Other programs adopted the idea and each added its own rules. As a result, "INI" really means a family of similar dialects.

Where you will see INI files

  • Windows and desktop applications: older settings files, game configuration, desktop.ini for folder customisation
  • Cross-platform tools: many programs read settings from .ini or .cfg files
  • Language tooling: Python's configparser reads INI-style files, and some Python and PHP tools use .ini for configuration
  • Hardware and firmware settings in some devices

Similar .conf and .cfg files often follow the same pattern, and Git's own config files use a close relative of the format.

Dialect differences to expect

Because there is no standard, details vary:

  • Comment characters: ; only, or ; and #.
  • Inline comments after a value: supported by some, treated as part of the value by others.
  • Separator: = almost everywhere; some accept :.
  • Quotes around values: kept literally by some parsers and stripped by others.
  • Key case: sensitive in some, insensitive in others.
  • Duplicate keys and sections: an error in some, last-wins or merged in others.
  • Nested sections or sub-sections: a few dialects allow dotted or quoted names; others do not.
  • Data types: none. Everything is a string until the program converts it.
  • Line continuation for long values: only in some.

Read the documentation of the program that uses the file.

INI versus other config formats

INI is flat: sections of simple pairs, with no real nesting, no lists and no types. That simplicity is its strength for small settings and its limit for anything else. TOML keeps the INI look while adding types, arrays and proper nesting, and YAML and JSON handle deeper structures.

How to open and edit an INI file

Use any plain-text editor. Notepad is the traditional choice on Windows. For a quick check of the structure, Docento's Text & Markdown Editor opens .ini files locally, shows them in a fixed-width font and flags lines that are not a comment, a section header or a key=value pair. The syntax rules it applies are the common denominator, so it cannot know a particular program's dialect.

Safety tips

  • Back up the file before editing.
  • Preserve the encoding. Older Windows INI files may not be UTF-8; see text file encodings.
  • Close the program that owns the file first, since some programs overwrite settings on exit.

More practical advice is in how to edit INI files safely, and the rules in INI file syntax.

Takeaway

An INI file is a simple text format of [sections] and key=value lines with comments. There is no single standard, so check the dialect your program expects before editing.

Try Docento's free PDF editor

No sign-up, 100% private — sign, annotate, and stamp PDFs in your browser.

Open the editor

Related Posts