INI Formatter
Parse and reformat INI config text with normalized spacing, one blank line between sections, and preserved comments.
Raw INI Input
Formatted Output
How to Use the INI Formatter
Paste raw INI text into the box — with [section] headers, key=value pairs, and ; or # comment lines — and it's parsed leniently and re-serialized with normalized formatting: a single consistent space around every =, one blank line between sections, trimmed whitespace, and all comments and blank lines preserved in their original position.
key=value → key = value
Example
Input debug=true (no spaces) is reformatted to debug = true, and a section immediately following a key=value pair with no blank line in between gets one inserted automatically, so every section is visually separated from the content above it.
Common Use Cases
- Cleaning up an inconsistently-formatted config file before committing it to source control.
- Standardizing spacing conventions across INI files written by different tools or people.
- Spotting a malformed line in a config file that isn't a valid section, comment, or pair.
FAQs
- What happens if my INI file has a syntax error? The formatter flags any line that isn't a valid comment, blank line, section header, or key=value pair with a warning message that includes the line number, rather than crashing or silently dropping content — the rest of the valid file is still formatted normally.
- Does this tool preserve comments and blank lines? Yes — comments (starting with
;or#) and blank lines are kept in their original position in the output, they're just not reformatted since they aren't key=value pairs or sections. - Does it support both semicolon and hash comment styles? Yes — both
;and#are recognized as comment markers, since different INI-parsing tools and languages use different conventions.
