User Rating 0.0
Total Usage 0 times
CSV Input
Drop CSV file here or click to browse Max 10 MB · .csv, .tsv, .txt
INI Output
Is this tool helpful?

Your feedback helps us improve.

About

INI configuration files use a rigid sectionkey=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.

csv to ini csv converter ini converter config file converter csv parser ini generator file converter

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:

{
state QUOTED if c = " and state = FIELD_STARTstate FIELD_START if c = delimiter and state QUOTEDstate MAYBE_END_QUOTE if c = " and state = QUOTEDfield += c otherwise (append to current field)

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:

[sectionNamer]
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 DialectComment CharMultilineDuplicate KeysEscape SequencesTypical Use
Windows API;NoLast winsNone.ini config files
Python configparser# and ;Yes (indent)Last winsNonePython app configs
PHP parse_ini_file;NoLast wins\n \t \\php.ini
MySQL my.cnf# and ;NoLast winsNoneDatabase config
Git .gitconfig# and ;Yes (backslash)Multi-valued\n \t \\Git settings
systemd unit files# and ;Yes (backslash)AppendedC-styleService definitions
Samba smb.conf# and ;Yes (backslash)Last winsNoneFile sharing config
Desktop Entry (.desktop)#NoLocale variantsStandardLinux app launchers
Boost property_tree;NoLast winsNoneC++ app configs
Delphi TIniFile;NoLast winsNoneDelphi/Pascal apps
RFC 4180 CSV (input)N/AYes (quoted)N/ADouble-quote ""Tabular data exchange
TSV variantN/ANoN/ANoneTab-separated data

Frequently Asked Questions

Values containing ;, #, [, ], or = are automatically wrapped in double quotes in the INI output. This ensures parsers like Python's configparser and PHP's parse_ini_file read the value correctly without interpreting the character as a comment delimiter or section header.
INI format does not support duplicate keys within the same section. If your CSV contains two columns both named port, the second column's value will overwrite the first for every section. The converter appends a numeric suffix (port, port_2) when the "Rename duplicates" option is enabled to prevent data loss.
Yes. The "Section name column" dropdown lists all detected headers. Selecting a column (e.g., hostname) uses each row's value in that column as the [section] name. That column is then excluded from the key-value pairs within the section. If two rows share the same value, a numeric suffix is appended to avoid section name collisions.
Yes. The parser implements RFC 4180 fully. A field that starts with a double-quote character continues across newlines until a closing unescaped double-quote is found. The resulting INI value preserves the content but replaces internal newlines with \n sequences, since most INI parsers do not support raw multiline values.
The converter accepts files up to 10 MB. Files larger than 1 MB are processed in a Web Worker to keep the UI responsive. For files exceeding the limit, split them using a command-line tool like split or process them server-side.
Empty cells produce a key with an empty value: key = (nothing after the equals sign). Most INI parsers return an empty string for such keys. If you prefer to omit empty keys entirely, enable the "Skip empty values" toggle in the settings panel.
Yes. The delimiter dropdown supports comma (,), semicolon (;), tab (\t), and pipe (|). European CSV exports from Excel typically use semicolons because the comma serves as the decimal separator in those locales.