FormatForge

CSV to INI Converter

Convert CSV spreadsheet data to INI configuration format instantly. Generate config files from tabular data. Free, secure, and works entirely in your browser.

CSV
INI

Drop a file here or click to upload

Supports .csv files

Understanding CSV and INI

CSV (Comma-Separated Values) is the universal interchange format for tabular data. It represents data as rows of fields separated by a delimiter, making it readable by every spreadsheet application, database tool, and programming language. CSV files are plain text with no embedded type information — every value is implicitly a string. Its simplicity makes it ideal for data export and import, but it cannot represent hierarchical structures, comments, or configuration semantics. Learn more about working with CSV in our comprehensive CSV guide.

INI (Initialization File) is one of the oldest configuration file formats in computing, dating back to early versions of MS-DOS and Windows. An INI file consists of sections (denoted by square brackets like [section]) containing key-value pairs (written askey=value). Despite its age, INI remains widely used today in PHP configuration (php.ini), MySQL settings (my.cnf), Git configuration (.gitconfig), Python's setup.cfg, systemd unit files, and countless Windows applications. Its simplicity and human readability make it a pragmatic choice for straightforward configuration needs. Explore INI in depth in our INI learning resource.

Both CSV and INI are plain text formats, but they serve different purposes. CSV organizes data into a flat table of rows and columns, while INI organizes data into named sections with key-value pairs. Converting CSV to INI maps each row to a distinct section and each column to a key within that section, effectively transforming a dataset into a series of configuration blocks that applications can parse with standard INI libraries.

Why Convert CSV to INI?

Although newer configuration formats like YAML and TOML have gained popularity, INI files remain deeply embedded in many software ecosystems. Here are the most common reasons to convert CSV data to INI format:

  • Generating configuration for legacy applications: Many Windows desktop applications, game engines, and industrial control systems read their settings from INI files. If you maintain configuration data in spreadsheets, converting to INI creates files these applications can consume directly without any code changes.
  • PHP and web server configuration: PHP's primary configuration file (php.ini) and many PHP applications use the INI format. Converting a spreadsheet of PHP settings, extensions, or module configurations to INI format enables rapid deployment across multiple servers.
  • Batch configuration generation: When deploying software to many machines or environments, you often need to generate slightly different INI configuration files for each target. Maintaining the data in a CSV spreadsheet and converting to INI automates this process and reduces the risk of manual configuration errors.
  • Database configuration files: MySQL (my.cnf), MariaDB, and other database systems use INI-style configuration. Converting a spreadsheet of database tuning parameters to INI format streamlines the process of applying settings across development, staging, and production environments.

How the Conversion Works

CSV to INI is a cross-format conversion that goes through JSON as an intermediate representation. The process follows three stages:

Stage 1 — CSV to JSON: The converter uses PapaParse to parse your CSV input. The first row is treated as column headers, and each subsequent row becomes a JSON object where the keys are the header names and the values are the corresponding cell contents. PapaParse handles quoted fields, escaped characters, and different delimiter types automatically.

Stage 2 — JSON normalization: The intermediate JSON array is cleaned and structured. Each object in the array is assigned a numeric index to generate unique INI section names. This step ensures that every row maps to a distinct, identifiable section in the final INI output.

Stage 3 — JSON to INI: Each JSON object is serialized as an INI section. The section header is generated using a numbered naming pattern ([item.0], [item.1], etc.), and each key-value pair in the object becomes a line in the format key=value. String values are written directly without quoting (as is standard in most INI implementations), and empty values produce keys with no value after the equals sign.

CSV ComponentJSON IntermediateINI Output
Header rowObject keysKey names within sections
Data row (row N)Object at index N[item.N] section
Cell valueString or number valueValue after = sign
Empty cellEmpty stringKey with empty value (key=)

Before and After Example

Here is a practical example showing how a 3-row CSV file containing server configuration data is converted to INI format with numbered [server.N] sections:

Input (CSV)

hostname,ip_address,port,max_connections
web-primary,10.0.0.1,80,1000
web-secondary,10.0.0.2,80,500
api-server,10.0.0.3,8080,2000

Output (INI)

[server.0]
hostname=web-primary
ip_address=10.0.0.1
port=80
max_connections=1000

[server.1]
hostname=web-secondary
ip_address=10.0.0.2
port=80
max_connections=500

[server.2]
hostname=api-server
ip_address=10.0.0.3
port=8080
max_connections=2000

Each CSV row becomes a numbered INI section. The first row maps to [server.0], the second to [server.1], and so on. Within each section, the column headers (hostname,ip_address, port, max_connections) become keys, and the cell values are written directly after the equals sign. Note that unlike TOML or JSON, INI does not distinguish between string and numeric types — all values are stored as plain text, and the reading application is responsible for parsing them.

Tips and Best Practices

Keep CSV headers simple and valid

INI keys should be simple, alphanumeric identifiers. Avoid spaces, special characters, and Unicode in your CSV headers. Use underscores or hyphens as separators (e.g.,max_connections, server-name) for keys that are universally compatible with INI parsers.

Watch for values that contain special characters

INI values that contain semicolons (;) or hash symbols (#) may be truncated by some INI parsers because these characters start inline comments. If your CSV data includes these characters, verify the output and consider quoting the values or escaping the characters for your target parser.

Rename sections after conversion if needed

The converter generates numbered sections like [item.0], [item.1]. If your target application expects specific section names (e.g., [database],[cache], [logging]), use find-and-replace in the output to rename the sections to match the expected configuration structure.

Remember that INI keys must be unique within a section

Unlike some other formats, INI does not support duplicate keys within the same section. If your CSV has duplicate column headers, the converter handles this by renaming them, but verify the output keys match what your target application expects.

Add comments to document your INI file

INI files support comments using semicolons (; comment) or hash symbols (# comment). After converting your CSV, add comments above sections or key-value pairs to explain the purpose of each configuration block. This is especially important for configuration files shared across teams or environments.

Consider the target parser's INI dialect

There is no single INI standard — different applications and libraries parse INI files slightly differently. Some support nested sections, some allow multiline values, and some are case-sensitive for keys while others are not. Know your target parser's expectations before relying on the converted output in production.

Related Tools

Explore more conversion tools to work with CSV and INI formats:

How to Convert CSV to INI

  1. Paste your CSV data in the input area, or upload a CSV file
  2. Click the "Convert" button
  3. View the converted INI output instantly
  4. Copy the result or download it as a file

Features

  • 100% client-side - your data never leaves your browser
  • No login or registration required
  • Instant conversion with real-time preview
  • Supports file upload and drag-and-drop
  • Download converted files directly
  • Works on mobile and desktop

Frequently Asked Questions

How does CSV to INI conversion work?

The converter first parses your CSV using PapaParse, converting each row into a JSON object. The JSON array is then serialized to INI format, where each row becomes a numbered section like [item.0], [item.1], etc. Column headers become the keys within each section, and cell values become the corresponding values.

Why convert CSV to INI?

INI files are one of the most common configuration formats for Windows applications, PHP (php.ini), MySQL (my.cnf), and many legacy systems. Converting CSV data to INI lets you generate configuration files for these systems directly from spreadsheet exports.

What INI structure does the converter produce?

Each CSV row becomes a numbered INI section using the pattern [item.0], [item.1], [item.2], and so on. Within each section, the column headers become keys and cell values become values, formatted as key=value pairs on separate lines.

Can I customize the section names in the INI output?

The converter generates numbered sections by default (e.g., [item.0], [item.1]). If you need custom section names, you can edit the output after conversion. Alternatively, if your CSV has a column that should serve as the section name, you can restructure your data accordingly.

How are data types handled in INI files?

INI format treats all values as strings — there is no native type system. Numbers, booleans, and other types from your CSV are written as plain text values. The consuming application is responsible for parsing these values into their appropriate types.

Is my data secure during conversion?

Yes. All conversion happens entirely in your browser using client-side JavaScript. Your CSV data never leaves your device — it is not uploaded to any server, not transmitted over the network, and not stored anywhere externally.

Can INI files handle multi-line values from CSV?

Standard INI format does not support multi-line values natively. If your CSV contains cells with line breaks, the converter will place the value on a single line. Some INI parsers support continuation lines with leading whitespace, but this behavior varies between implementations.

What are the limitations of the INI format compared to CSV?

INI is a flat key-value format organized into sections. It cannot represent arrays, nested objects, or complex data structures. Each key within a section must be unique. For datasets with many columns or complex relationships, consider converting to YAML, TOML, or JSON instead.