What are CSV tools?
A CSV file is the simplest way to move a table between programs, and it is rarely clean. The columns come in the wrong order, there are columns you do not need, the rows have stray spaces, empty lines and duplicates, and the target system wants a semicolon instead of a comma. This page gathers the small operations you keep needing in one place, so you do not open a spreadsheet or write a script for each one.
You paste CSV, TSV or cells copied from a spreadsheet, and the tool shows the result as you change the options. You can choose which columns to keep, remove the others, and reorder them with the move up and move down buttons. You can sort the rows by one column, in ascending or descending order, comparing as text (with natural ordering, so 9 comes before 10) or as numbers. You can transpose the table, trim spaces, drop empty rows and drop duplicate rows. On output you pick the separator (comma, semicolon, tab or pipe) and decide whether to quote every field.
Cells with commas, quotes and line breaks are parsed and written correctly, so a round trip does not corrupt data. Everything runs in your browser. The text you paste is not sent anywhere.
How to clean and reshape a CSV
- Paste the CSV into the input box. The separator is detected, so a semicolon file works as well as a comma file.
- Keep "first row is the header" on if the first row has column names. The column list below it shows those names.
- In "Columns", untick the columns you do not want and use the arrows to move the others into the order you need.
- Under "Sort", choose a column, a direction and how to compare: as text or as numbers. Pick "no sorting" to leave the order alone.
- Switch on "trim spaces", "drop empty rows" and "drop duplicate rows" as needed. Switch on "transpose" to swap rows and columns.
- Under "Output", choose the separator and, if the destination needs it, "quote every field".
- Read the summary of rows and columns, then copy the result. For a Markdown table go to CSV to Markdown; for a chart go to Chart maker.
Examples
Pick and reorder columns
Input:
a,b,c
1,2,3
4,5,6Keeping column 3 and then column 1 gives:
c,a
3,1
6,4The header follows the columns. A column can also be listed twice: keeping the second column twice gives b,b with 2,2 below it.
Sort as text or as numbers
Input:
n,v
x,10
y,9
z,
w,100
v,abcSorting by v ascending, as text or as numbers, gives the rows in the order y, x, w, v, z: 9, 10, 100, then the non-number abc, then the empty cell last. Sorting descending as numbers gives w, x, y, v, z. Empty cells stay last in both directions, and rows with equal values keep their original order. Money sorts as a number too. Input "$1,200", $99, €5 sorted as numbers becomes €5, $99, "$1,200".
Transpose and change the separator
Transposing:
a,b,c
1,2,3gives:
a,1
b,2
c,3Changing the output separator to semicolon turns a,b and "x,y",2 into:
a;b
x,y;2The comma no longer needs quotes. With "quote every field" on, a,b and "x,y",2 becomes "a","b" and "x,y","2".
Common mistakes
- Sorting numbers as text. Natural ordering helps with 9 and 10, but dollar signs, percent signs or mixed text are better compared as numbers.
- Choosing a column that does not exist. The tool names the missing column in the error. This happens when you change the data after choosing the columns.
- A quote that never closes. The error says which line. Close the quote before processing.
- Rows with a different number of columns. The tool reports it so you can fix the row.
- Dropping duplicates before trimming.
BrunoandBrunoare different until the spaces are trimmed. Turn on trim together with drop duplicates. - Forgetting that transpose changes the header. After transposing, the first column becomes the row labels. Transposing twice gives back the original table.
Frequently asked questions
Does the tool upload my CSV?
No. Parsing, sorting and writing all happen in your browser, so a customer list or a payroll export stays on your machine.
What is natural sorting?
It compares the numbers inside text as numbers, so item9 comes before item10. Plain alphabetical order would put item10 first.
Can I change a semicolon file to a comma file?
Yes. The input separator is detected, and under "Output" you choose comma, semicolon, tab or pipe. Quoting is added only where a value needs it.
Where do I go after cleaning the data?
Turn it into a Markdown table with CSV to Markdown, into JSON with Excel to JSON, or into a chart.