Convert arff to csv

Convert ARFF to CSV

Convert Weka ARFF datasets to CSV with Weka or Python and check schema and missing-value loss.

Make CSV files online

We can't read ARFF files yet, so this conversion isn't available. If you can export your work to one of these formats - or others - we'll turn it into CSV:

How to convert arff to csv file

Teams convert Weka datasets when Excel, a database importer, or a collaborator expects a flat CSV table instead of ARFF declarations. CSV is easier to inspect and exchange, but the conversion removes schema information stored in the ARFF header.

ARFF and CSV formats

ARFF (Attribute-Relation File Format) is a plain-text dataset format used primarily by the Weka machine-learning software. An ARFF file contains a header with a relation name and @ATTRIBUTE declarations, followed by an @DATA section containing records.

Attributes can be numeric, nominal, string, date, and, in Weka, relational. A nominal declaration such as @ATTRIBUTE class {yes,no} defines both the field type and its allowed values. ARFF can also store sparse rows such as {0 1,3 blue}, where omitted values use the format's default value.

CSV stores a flat table as delimiter-separated rows, normally with column names in the first row. Spreadsheet applications, pandas, R, database import tools, and many data portals accept CSV directly. CSV has no standard type declarations, nominal-value lists, relation name, comments, or sparse-row notation.

Convert with Weka

Weka is the most reliable desktop converter because it reads ARFF headers, quoted values, missing values, nominal attributes, and sparse instances.

  1. Open Weka and start Explorer.
  2. On the Preprocess tab, select Open file... and choose the .arff file.
  3. Check the attribute list and instance count to confirm that Weka loaded the expected dataset.
  4. Select Save..., choose CSV data files (*.csv), enter an output name such as dataset.csv, and save.
  5. Open the result in a text editor or the intended destination program and verify the header row, delimiter, character encoding, and missing-value representation.

For repeatable conversions, run Weka's CSV saver from a terminal. Replace /path/to/weka.jar with the installed Weka JAR path:

java -cp /path/to/weka.jar weka.core.converters.CSVSaver -i input.arff -o output.csv

On Windows, quote paths containing spaces, for example "C:\Program Files\Weka-3-8\weka.jar". Use the Weka installation's supplied launcher or classpath configuration if its version requires additional libraries.

Convert with Python or an online service

pandas does not natively read ARFF files; it needs an ARFF parser. For ordinary dense ARFF files, install liac-arff and pandas:

pip install liac-arff pandas

import arff
import pandas as pd

with open("input.arff", encoding="utf-8") as source:
    dataset = arff.load(source)

columns = [name for name, _ in dataset["attributes"]]
pd.DataFrame(dataset["data"], columns=columns).to_csv("output.csv", index=False)

Test sparse ARFF files before using a Python parser in production; Weka is the safer choice when sparse instances, unusual quoting, or Weka-specific attribute definitions are involved.

For a small non-confidential file, browser services such as Zamzar and Convertio may offer ARFF-to-CSV conversion. Confirm current ARFF support and retention terms before uploading. Do not upload customer, medical, financial, research, or proprietary datasets to an external conversion service.

Compatibility checks

Preserve the original ARFF file. CSV retains values but loses declared types, relation names, attribute comments, nominal-value restrictions, and other header metadata. Keep the ARFF header or document the schema separately when recipients must distinguish numbers, dates, categories, and free text.

ARFF missing values are commonly written as ?. Depending on the converter, the CSV output may contain an empty field, ?, or another marker. Check this before importing into software that treats blanks, NA, and question marks differently.

CSV fields containing commas, quotation marks, or line breaks must be quoted according to CSV rules. Do not convert ARFF by replacing commas or splitting lines with basic text commands; those methods corrupt quoted values and cannot expand sparse rows.

Some spreadsheet installations expect a semicolon rather than a comma because of regional settings. If columns appear in one cell after opening the file, use the spreadsheet's text-import dialog and explicitly select the delimiter rather than editing the CSV manually.

ARFF vs CSV: format comparison

How the ARFF and CSV formats compare on the properties that matter most for this conversion.

Comparison of the ARFF and CSV file formats
Property .ARFF Attribute-Relation File Format .CSV Comma-Separated Values
Plain-text readable Yes Yes
Data types Typed Typed
Nested structures No No
Formulas No No
Multiple tables or sheets No No
Typical file size Small Small
Open standard Partly open Yes
Best used for Data exchange Data exchange
Developer University of Waikato / WEKA project —
MIME type text/arff text/csv

Frequently asked questions

Will ARFF attribute types and nominal value lists be preserved in CSV?

No. CSV preserves the table values but not the ARFF relation name, attribute declarations, data types, or predefined nominal-value lists, so those may need to be recreated when the CSV is imported.

Are missing values and sparse ARFF data changed when exported to CSV?

Missing values may be written using the exporting software's CSV representation, while sparse ARFF records are expanded into ordinary rows with a value for every column. Check the result before using it for analysis, especially if empty cells could be confused with actual empty text.

Will ARFF strings containing commas or quotes work correctly in CSV?

They should be enclosed and escaped according to CSV rules, but an incorrect export can split one ARFF value into multiple columns. This commonly happens with text or nominal values containing commas, quotation marks, or line breaks.

Can I convert CSV back to ARFF without losing information?

Not without restoring information that CSV does not contain, such as attribute types, nominal categories, the relation name, and some missing-value conventions. The data can usually be reconstructed, but the original ARFF schema and formatting are not guaranteed to return automatically.

Additional formats for
arff file conversion

Reverse conversion

Convert to csv from
other formats

Share on social media: