INI Formatter
Format and beautify INI / config files. Normalizes [section] headers and key = value spacing, trims trailing whitespace, and puts one blank line between sections. Optionally sorts keys alphabetically within each section. Comments and section order are preserved.
Input
Output
Guides
The INI Formatter cleans up and beautifies INI configuration files. Paste in messy config text and get back a consistently formatted version with normalized spacing, tidy section headers, and predictable blank lines — without changing what your settings actually mean.
What is an INI file?
INI (short for "initialization") is one of the oldest and simplest configuration formats. A file is a list of key = value pairs, optionally grouped under [section] headers, with ; or # marking comment lines. Because the format is so easy to read and edit by hand, it is still used everywhere:
php.ini— PHP runtime configurationmy.cnf/my.ini— MySQL / MariaDB settings.gitconfig— Git user and repository configurationsetup.cfg/tox.ini— Python project and tooling configdesktop.ini— Windows folder customization
There is no single official INI standard, so files drift over time: some keys use key=value, others key = value; blank lines pile up; sections get out of order. This tool applies one consistent style so diffs stay small and files stay readable.
How to use it
- Paste your INI content into the input box (or click Try an example).
- The formatted result appears instantly in the output panel, ready to copy or download.
- Toggle Sort keys alphabetically within each section if you want the keys in each section reordered A–Z.
What the formatter does
- Rewrites every pair as
key = valuewith exactly one space on each side of=. - Trims trailing whitespace from every line.
- Puts a single blank line between sections and removes stray blank-line runs inside a section.
- Preserves comments exactly as written — only their surrounding whitespace changes.
- Keeps section order unchanged.
Frequently asked questions
Does formatting change my configuration's meaning?
No. Values are copied through verbatim (only their surrounding whitespace is trimmed), comment text is never rewritten, and sections are never reordered. Only the optional sort toggle changes key order, and only within a section.
What happens to comments when I sort keys?
A comment placed directly above a key is treated as documentation for that key, so it moves together with the key when sorting. Comment text itself is never altered.
Are inline comments after a value supported?
The formatter treats anything after = as the value, so an inline ; note is preserved as part of the value rather than stripped. This keeps the file's meaning intact for parsers that read the whole line.
Is the output stable?
Yes — the formatter is idempotent. Running it again on already-formatted text produces the exact same result.
Is my data private?
Yes. Formatting runs entirely in your browser. Your configuration text is never uploaded to a server.