Loading INI Validator...

How to Validate INI Files - Step by Step Guide

Step 1

Input Your INI Configuration File

Let's get your INI configuration file into the validator! Whether you're debugging config issues or verifying syntax, you have several convenient options:

•
Paste directly: Copy your INI configuration and paste it into the input editor
•
Upload a file: Click "Upload" to select an .ini, .conf, .cfg, or .txt file from your computer
•
Try the sample: Click "Sample" to load example data and see how the validator works
Step 2

Read the Verdict

About half a second after you stop typing, the result panel updates. While your latest edit has not been checked yet, the badge reads Checking instead of showing an old answer. The file counts as invalid when:

•
A section header is not closed: [database with no ].
•
Something follows the closing ]: only a ; or # comment may come after [section].
•
A value has no key: a line such as = 5432 that starts with the equals sign.
Step 3

Check the Notes for Other Readers

A file can follow the Standard INI rules and still trip up a particular program. When that applies, the result lists it under "Worth knowing" with line numbers:

•
Python configparser: keys above the first section, a key or section that appears twice, lines without an = sign, indented lines that it joins to the value above, and inline comments it keeps as part of the value.
•
Node ini package: values it cuts at a ; or # (such as abc#123), section headers followed by a comment, and a byte order mark at the start.
•
Statistics: the number of sections, key lines, comment lines and empty lines in the file.
Step 4

Fix, Then Copy or Download

Edit the text right in the editor and the check runs again. Nothing is rewritten for you, so the file you copy is the file you typed:

•
Copy: puts the editor text on the clipboard, unchanged.
•
Download: saves the same text as config.ini.
•
Tidy it up: the INI Formatter fixes spacing, and INI to JSON shows exactly how the values are read.

Frequently Asked Questions

Which INI rules does the validator check?

INI has no single official standard, so the page checks the Standard INI rules that our INI to JSON converter uses by default: [section] headers, key = value lines, comment lines starting with ; or #, a ; or # after a space starting an inline comment, and "..." or '...' quoting a value. Three things make a file invalid: a section header without its closing ], text after a closing ] that is not a comment, and a line that starts with = and so has no key. Each one is reported with its line number and the line itself.

Why does my file pass here but fail in Python?

Python's configparser is stricter than most INI readers. It refuses keys above the first [section], a section or key that appears twice, and lines without an = or : sign, and it reads an indented line as part of the value above it. When your file does any of these, the result lists it under "Worth knowing" with the line numbers, so you can fix it before configparser complains.

What about the Node ini package and PHP?

They accept almost anything, which is why a "valid" answer from them means little. The validator points out the places where the Node ini package reads your file differently from what you probably meant: it cuts an unquoted value at any ; or # (so abc#123 becomes abc), it treats a section header followed by a comment as a key, and it does not skip a byte order mark at the start of the file.

What do the statistics count?

Sections is the number of different section names. Key lines counts every key = value line, plus lines with no = sign, which most readers take as switches set to true. Comment lines and empty lines are counted as they appear; the line break at the very end of the file does not count as an empty line.

Does the validator change my file?

No. It only reads the text. Copy and Download give you exactly what is in the editor, so values like 8901240544102066246, 00501 and 14.50 stay as you typed them. To tidy the spacing, use the INI Formatter.

Is my INI file uploaded anywhere?

No. The check runs in your browser and the text is not sent to our server, which matters for config files that hold passwords or connection strings. Uploads up to 10 MB are accepted, and older Windows files saved as Windows-1252 are read correctly. Reloading the page starts with an empty editor.