CSV to INI Converter
Convert CSV files to INI configuration format online. Supports RFC 4180 CSV parsing, custom section naming, key mapping, and instant download.
About
INI configuration files use a rigid section→key=value hierarchy that tolerates zero ambiguity in special characters like [, ], ;, and #. Feeding a malformed INI into a production parser (Python's configparser, PHP's parse_ini_file, or Windows API GetPrivateProfileString) silently drops keys or merges sections. This tool implements a full RFC 4180 CSV tokenizer that correctly handles quoted fields, embedded commas, escaped double-quotes, and multiline cell values before mapping each row to an INI section. Characters reserved by the INI specification are escaped automatically. The converter assumes the first CSV row contains headers unless you disable that option.
Limitations: INI format is flat. Nested structures or arrays cannot be represented natively. If your CSV has duplicate header names, later columns overwrite earlier ones within the same section. The tool approximates section names from a designated column or from row indices when no suitable identifier column exists. Pro Tip: if your target application uses a strict INI dialect (e.g., systemd unit files), verify that your key names contain no spaces. Some parsers reject whitespace around the = sign.
Formulas
The CSV parser operates as a finite state machine with three states. Each character c at position i transitions the machine according to these rules:
The INI output maps each data row r (where r ∈ [1, N]) to a section. For each column j with header hj and cell value vr,j:
hj = vr,j
Where sectionNamer is derived from a user-selected key column or defaults to section_r. Reserved INI characters ([, ], ;, #, =) found inside values are wrapped in double quotes. Total output sections = N − 1 (excluding the header row).
Reference Data
| INI Dialect | Comment Char | Multiline | Duplicate Keys | Escape Sequences | Typical Use |
|---|---|---|---|---|---|
| Windows API | ; | No | Last wins | None | .ini config files |
| Python configparser | # and ; | Yes (indent) | Last wins | None | Python app configs |
| PHP parse_ini_file | ; | No | Last wins | \n \t \\ | php.ini |
| MySQL my.cnf | # and ; | No | Last wins | None | Database config |
| Git .gitconfig | # and ; | Yes (backslash) | Multi-valued | \n \t \\ | Git settings |
| systemd unit files | # and ; | Yes (backslash) | Appended | C-style | Service definitions |
| Samba smb.conf | # and ; | Yes (backslash) | Last wins | None | File sharing config |
| Desktop Entry (.desktop) | # | No | Locale variants | Standard | Linux app launchers |
| Boost property_tree | ; | No | Last wins | None | C++ app configs |
| Delphi TIniFile | ; | No | Last wins | None | Delphi/Pascal apps |
| RFC 4180 CSV (input) | N/A | Yes (quoted) | N/A | Double-quote "" | Tabular data exchange |
| TSV variant | N/A | No | N/A | None | Tab-separated data |
Frequently Asked Questions
split or process them server-side.