An INI formatter restructures INI configuration files with consistent spacing around the = sign, blank lines between sections, and preserved comments. Used for php.ini, mysql.cnf, git config, and application config files.
Formatted INI will appear here...
INI Config Examples
How to Use the INI Config Formatter
INI configuration files from servers, databases, and applications often arrive inconsistently formatted — mixed spacing around =, no blank lines between sections, or sections out of order. An INI formatter applies consistent spacing, groups sections cleanly, and preserves all comments.
Step 1: Paste Your INI File
Copy your INI config — from php.ini, mysql.cnf, a git config, or any .ini or .cfg file — and paste it into the input area. The formatter supports [section] headers, key = value and key: value pairs, and ; and # comments.
Step 2: Options
Enable Sort keys to alphabetically sort key=value pairs within each section — useful for large config files where you need to find specific settings quickly. Leave it off to preserve the original key order.
Step 3: Format or Minify
Click Format INI to apply consistent key = value spacing with blank lines between sections. Click Minify to strip comments and blank lines, producing the smallest valid INI file.
INI File Best Practices
Well-formatted INI files use consistent spacing (key = value with spaces around =), blank lines between sections, and comments above the settings they describe. Duplicate keys in the same section should be avoided — most parsers use the last definition. The ; comment style is most widely supported; some parsers don't recognize #.
FAQ
Is the INI formatter free?
Yes, completely free with no signup required. Format unlimited INI files in your browser.
Is my INI data safe?
Yes. All formatting runs locally in your browser. Your config data is never sent to any server.
What is an INI file?
INI files are simple configuration files structured as sections ([section]) containing key=value pairs. They're used by PHP (php.ini), MySQL (my.cnf), git (.gitconfig), Windows applications, and many other tools. Comments use ; or # at the start of a line.
Does the formatter preserve comments?
Yes. Both ; and # comments are preserved in the formatted output. Comments on their own line are kept above the key they precede. The minifier option strips all comments.
Can I sort keys alphabetically?
Yes. Enable the 'Sort keys' toggle before formatting to sort all key=value pairs alphabetically within each section. This makes it easier to find specific settings in large config files.
What INI formats are supported?
The formatter handles standard INI syntax: [section] headers, key=value pairs, key: value pairs (colon separator), comments (; and #), blank lines, and multi-line values with continuation characters.
Can I remove duplicate keys?
Yes. When duplicate keys exist in the same section, the formatter keeps the last definition. This matches the behavior of most INI parsers which overwrite earlier values with later ones.