CSV to ARFF Converter
Turn a CSV file into an ARFF dataset for machine learning and data mining tools. Column types are detected automatically, nominal attributes can be created for columns with few values, and empty cells become missing values.
How to Convert CSV to ARFF
Quick answer: paste your CSV or open the file; the ARFF appears below. Copy it or download the .arff file.
-
1
Add your CSV
Paste it or open a file.
-
2
Choose options
Adjust the output on the right.
-
3
Check the ARFF
Errors are explained clearly.
-
4
Copy or download
Save it as .arff.
What You Get
What Is CSV?
CSV (comma-separated values) is the universal spreadsheet exchange format: one row per line and a comma between values, with quotes around values that contain commas, quotes or line breaks. Every spreadsheet, database and data tool can read and write CSV.
What Is ARFF?
ARFF (Attribute-Relation File Format) is a data format used by machine learning and data mining tools. A header describes the dataset with @relation and lists every column with @attribute and its type, numeric, nominal or string, and the rows follow after @data.
Why Convert CSV to ARFF?
Many machine learning tools and courses use ARFF, while most data comes from spreadsheets as CSV. Converting saves you writing the header by hand and getting attribute types and quoting right.
How the Conversion Works
The first row gives the attribute names. Columns whose values are all numbers become numeric, columns with few different values can become nominal {a,b,c}, and the rest become string. Values with spaces or commas are quoted and empty cells become ?.
Example
With Nominal up to 5, the sample becomes @relation data, numeric id and score, string name and city, and @attribute passed {yes,no}, followed by the @data rows.
Who Uses It?
Students in data mining and machine learning courses, researchers preparing datasets and analysts using ARFF-based tools. Because everything happens in the browser, it is also safe for internal and confidential files.
Using Your ARFF File
Load the ARFF file in your machine learning tool. Check the attribute types: numeric columns are detected automatically, and columns with few different values can be made nominal, which many algorithms need for class labels. Rename the relation to describe your dataset.
Common Problems in CSV Input
Check that the first row holds the column names and that every row has the same number of values. Values containing commas, quotes or line breaks must be wrapped in double quotes, with inner quotes doubled. The separator is detected automatically, so files using semicolons or tabs also work. Very wide files work too, though the result may be easier to check in smaller samples first.
Checking Your ARFF Output
Check the attribute list: columns containing only numbers become numeric, and other columns become string unless you set a nominal limit, which turns columns with few distinct values into lists like {yes,no}. Empty cells become ? as ARFF expects. Names with spaces are quoted automatically. Rename the relation to describe your dataset before loading it.
Step by Step
Start by pasting your CSV into the input box, or press Open File to load it from your device. The converter reads it straight away and shows the ARFF in the output box. If the input has a problem, a short message explains what is wrong and where, so you can fix it in place. Next, adjust the options on the right; the output refreshes immediately so you can compare. When you are happy, press Copy to put the result on your clipboard, or Download to save it as a .arff file ready to use.
Private, Free and Instant
The converter is free, with no sign-up, no limit beyond the 5 MB file size and no watermark. It runs in your browser, so settings files with passwords, server addresses or customer data are never uploaded or stored. Paste the content, drop a file on the input box or press Open File, then copy the result or download it with the right file extension. It works on Windows, Mac, Linux, Chromebooks, iPhone and Android.
CSV to ARFF: Preparing Data for Weka
Weka reads ARFF, which declares each attribute's type before the data. Converting from CSV adds that header.
Type detection
Numeric columns become numeric attributes, and columns with a few repeating values become nominal attributes with a listed set of values. Missing cells become ?. Check types before use.
For the reverse, see ARFF to CSV.
Frequently Asked Questions
Questions about CSV to ARFF