Validate an INI file

Check INI sections and keys for malformed headers, duplicates, and empty names.

freeworks offlinenothing uploaded
ToolINI Validator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The input is parsed into sections and leaf keys, then source lines are scanned for duplicate sections, duplicate keys, unclosed headers, and empty key names. Counts come from the parsed structure while warnings retain line locations.

  • Global keys are accepted because common INI dialects allow them.
  • Duplicate findings are warnings so intentional repeated-key dialects remain visible.

Worked example

Valid database config section
Validate a well-formed INI configuration file
Input
											[database]
host=localhost
port=5432
										
Output
												Valid: yes
Section count: 1
Key count: 2
											

When to use this

Application startup checks, package-manager CI, and legacy preference migrations validate INI files.

Edge cases

  • Duplicate keys warn even when the parser keeps the last value.
  • A header without its closing bracket is invalid rather than a normal key.
  • An equals sign with no key name is reported instead of accepted as an empty setting.

References