TSV Column Sorter
World's simplest tsv tool
Simple and free online TSV column sorter. Just paste a TSV table and choose the column that should control the table values order. You can select the column by position or header text and sort its values as text, as numbers, by length, or by complexity. You can also keep the first row fixed as a header, handle rows with missing fields, and skip comments or empty rows before sorting. Created by programmers from team Browserling.
announcement
a new project!
Super exciting news! We just launched TECHURLS – simple and fun tech news reader. Check it out!
A link to this tool, including input, options and all chained tools.
Can't convert.
What is a TSV Column Sorter?
learn more about this tool
This online tool sorts Tab Separated Values (TSV) data by reading the values in a selected column and rearranging the table rows in the specified order. Sorting a TSV table does not mean sorting a single column. The tool uses the selected column only to decide the order, then moves complete rows into that order so the table records stay intact. The primary sort column can be selected by position (e.g., 1, 2, or -1 for the last column) or by matching the header text in the first row. When primary values repeat, secondary sort columns can be used to decide how those matching rows should be arranged. For example, you can sort a product list by category first and then by price, or sort a contact list by city first and then by name. The first TSV row can stay fixed as a header, or it can be sorted together with the other rows when it contains regular data. The tool can compare values as text (alphabetically), as numbers, by length (number of characters), or by complexity. The output can be arranged in ascending or descending order, and case-sensitive sorting can treat values such as "Apple" and "apple" as different text. If some TSV rows have missing fields, the tool can keep those short rows unchanged, add blank fields, or insert custom fill text into the missing positions. Before the sort runs, empty rows and rows marked as comments can be removed to prevent notes from being mixed into the sorted table. Tsv-abulous!
TSV Column Sorter examples
Click to useSort Recipe Items by Grams
In this example, we sort a simple two-column TSV recipe list. The first column contains ingredient names and the second column contains their amounts in grams. We sort by column 2, so the ingredients are ordered from the smallest gram amount to the largest.
flour 250
salt 5
sugar 40
oil 30
yeast 7
salt 5
yeast 7
oil 30
sugar 40
flour 250
Required options
Choose how TSV values
are compared.
Choose the order of the
sorted TSV values.
Select how to handle TSV
rows with missing fields.
Choose the main sort column
by number.
If main values match, sort
by these extra columns.
Example: "2, 4".
Choose the main sort column
by its header text.
If main values match, sort
by these extra headers.
One header per line.
Sort the first TSV row
together with the other rows.
Sort "Apple" and "apple" as
different text values.
Text to insert into missing
fields.
Skip rows marked as
comments before sorting.
Skip empty rows before
sorting.
Sort Gym Classes by Name Length
In this example, we sort a TSV gym class schedule by the length of each class name. The table has two columns: class and room. We sort the table by the first column, keeping the first row as the header. We choose the length-based sort method and use ascending order, so shorter class names appear first and longer class names appear later. The input TSV has a missing room value for the stretching class, so we pad the data table with the custom value "unassigned". This creates a complete two-column TSV structure in the output.
class room
Pilates Studio
HIIT Gym
Conditioning Hall
Boxing Ring
Yoga Studio
Stretching
Kickboxing Mat
TRX Straps
class room
TRX Straps
HIIT Gym
Yoga Studio
Boxing Ring
Pilates Studio
Stretching unassigned
Kickboxing Mat
Conditioning Hall
Required options
Choose how TSV values
are compared.
Choose the order of the
sorted TSV values.
Select how to handle TSV
rows with missing fields.
Choose the main sort column
by number.
If main values match, sort
by these extra columns.
Example: "2, 4".
Choose the main sort column
by its header text.
If main values match, sort
by these extra headers.
One header per line.
Sort the first TSV row
together with the other rows.
Sort "Apple" and "apple" as
different text values.
Text to insert into missing
fields.
Skip rows marked as
comments before sorting.
Skip empty rows before
sorting.
Sort TSV Contact Log Alphabetically
In this example, we clean and sort a small TSV contact list. Each contact has three short fields: name, city, and phone. We use header-based sorting, so the primary sort header is "city" and the secondary sort header is "name". This is useful for a contact sheet where people should first be grouped by city, and then listed alphabetically inside each city. The first row stays fixed, and the values are sorted as text in ascending order. Before sorting, the cleanup options remove rows that start with the "#" comment prefix and also remove blank rows.
name city phone
Maya Boston ***84
# old contact
Ben Austin ***48
Sofia Boston ***92
Ava Austin ***16
Lucas Denver ***75
Noah Seattle ***39
Clara Austin ***24
Ella Boston ***62
Ethan Seattle ***08
Liam Denver ***81
name city phone
Ava Austin ***16
Ben Austin ***48
Clara Austin ***24
Ella Boston ***62
Maya Boston ***84
Sofia Boston ***92
Liam Denver ***81
Lucas Denver ***75
Ethan Seattle ***08
Noah Seattle ***39
Required options
Choose how TSV values
are compared.
Choose the order of the
sorted TSV values.
Select how to handle TSV
rows with missing fields.
Choose the main sort column
by number.
If main values match, sort
by these extra columns.
Example: "2, 4".
Choose the main sort column
by its header text.
If main values match, sort
by these extra headers.
One header per line.
Sort the first TSV row
together with the other rows.
Sort "Apple" and "apple" as
different text values.
Text to insert into missing
fields.
Skip rows marked as
comments before sorting.
Skip empty rows before
sorting.
Pro tips
Master online tsv tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinetsvtools.com/sort-tsv-columns?input=flour%09250%0Asalt%095%0Asugar%0940%0Aoil%0930%0Ayeast%097&use-column-number=true&use-column-name=false&column-number=2&secondary-column-numbers=&column-name=grams&secondary-column-names=&sort-headers=true&sort-method=numerically&sort-order=increasing&case-sensitive=true&incomplete-format=leave-incomplete&custom-value=N%2FA&remove-comments=true&comment-character=%23&remove-empty-lines=true
All tsv tools
Quickly change the TSV delimiter to a different symbol.
Quickly generate random TSV data.
Quickly extract selected columns from a TSV file.
Quickly delete selected columns in a TSV file.
Quickly remove tabs that go between TSV columns and merge all data.
Quickly add quotes around TSV columns.
Quickly remove quotes that surround TSV columns.
Quickly swap columns in a TSV file.
Quickly sort TSV data by selected column values.
Quickly convert a TSV file to a JSON data structure.
Quickly convert a JSON data structure to TSV format.
Quickly convert a TSV file to XML markup.
Quickly convert XML markup to a TSV file.
Quickly convert a TSV file to YAML markup.
Quickly convert YAML data to a TSV file.
Quickly convert TSV data to CSV data.
Quickly convert CSV data to TSV data.
Quickly convert TSV data to nicely aligned text columns.
Quickly convert text columns to TSV columns.
Quickly convert TSV data to base64 encoding.
Quickly convert base64-encoded TSV data to TSV data.
Quickly convert a TSV file to URL-encoding.
Quickly convert a URL-encoded TSV file back to TSV.
Quickly add one or more columns before the first TSV column.
Quickly append new columns at the end of a TSV file.
Quickly insert new columns anywhere in a TSV file.
Quickly replace selected columns in a TSV file.
Quickly remove extra spaces around TSV columns.
Quickly truncate the contents of TSV cells to any length.
Quickly exchange TSV columns with rows.
Quickly exchange TSV rows with columns.
Quickly transpose a TSV file.
Quickly check a TSV file for errors and report them.
Coming soon
These tsv tools are on the way
Display TSV Statistics
Print information about a TSV file.
Calculate TSV Entropy
Find the complexity of a TSV file.
Show TSV Structure
Create an abstract drawing that shows the structure of a TSV.
View and Edit TSV
Show a TSV file in a neat editor and allow easy editing.
Convert TSV to Double-TSV
Convert a TSV file to a double-TSV file.
Convert Double-TSV to TSV
Convert a double-TSV file to a regular TSV file.
Convert TSV to HTML Table
Convert a Tab Separated Values file to an HTML table.
Convert HTML Table to TSV
Convert an HTML table to a Tab Separated Values file.
Convert TSV to Markdown
Convert a TSV file to a Markdown table.
Convert Markdown to TSV
Convert a Markdown table to a TSV file.
Convert TSV to PDF
Convert a Tab Separated Values file to a PDF document.
Convert PDF to TSV
Convert a PDF document to a Tab Separated Values file.
Convert TSV to Image
Draw Tab Separated Values as a table and output it as an image.
Convert Image to TSV
Extract data in an image and format it as a TSV file.
Convert TSV to Excel
Convert a Tab Separated Values file to an Excel spreadsheet.
Convert Excel to TSV
Convert an Excel file to a Tab Separated Values file.
Convert TSV to LaTeX
Convert a TSV file to LaTeX code that generates a table.
Convert TSV to ASCII Table
Convert a Tab Separated Values file to a neat ASCII table.
Convert ASCII Table to TSV
Convert an ASCII table to a Tab Separated Values file.
Convert TSV to SQL
Convert a Tab Separated Values file to an SQL query.
Convert TSV to SQLite
Convert a Tab Separated Values file to an SQLite database.
Convert SQLite to TSV
Export tables from an SQLite database as TSV files.
Convert TSV to PSV
Convert a TSV file to a PSV (Pipe Separated Values) file.
Convert PSV to TSV
Convert a PSV (Pipe Separated Values) file to a TSV file.
Convert TSV to HSV
Convert a TSV file to a HSV (Hash Separated Values) file.
Convert HSV to TSV
Convert a HSV (Hash Separated Values) file to a TSV file.
Convert TSV to SSV
Convert a TSV file to a SSV (Semicolon Separated Values) file.
Convert SSV to TSV
Convert a SSV (Semicolon Separated Values) file to a TSV file.
Convert TSV to 0SV
Convert a TSV file to a 0SV (Null Separated Values) file.
Convert 0SV to TSV
Convert a 0SV (Null Separated Values) file to a TSV file.
Split a TSV File
Create multiple TSV files from the given TSV file.
Merge TSV Files
Merge together two Tab Separated Values files.
Delete Empty TSV Columns
Remove columns that have no values in a TSV file.
Delete Empty TSV Rows
Remove rows that have no values in a TSV file.
Delete Empty TSV Lines
Remove lines in a TSV file that are blank.
Delete TSV Comments
Delete TSV lines that are comments.
Filter TSV Data
Filter rows and columns that match a pattern.
Find Values in TSV
Find certain values in TSV cells.
Find Duplicate TSV Rows
Extract repeated rows in a TSV file.
Merge Duplicate TSV Rows
Combine duplicate rows in a TSV file.
Deduplicate TSV Rows
Remove repeated rows from a TSV file.
Delete Duplicate TSV Rows
Delete duplicate rows from a TSV file.
Compress TSV
Minify a TSV file and remove extra spaces and indentation.
Compare Two TSV Files
Diff two TSV files and visually display the differences.
Rotate TSV Columns
Rotate TSV columns to the left or right.
Rotate TSV Rows
Rotate TSV rows up or down.
Cut a TSV File
Cut a fragment from a TSV file.
Slice a TSV File
Extract a slice (rows/columns/cells) of a TSV file.
Randomize TSV Values
Shuffle all data values in a TSV file.
Randomize TSV Columns
Shuffle the order of TSV columns.
Randomize TSV Rows
Shuffle the order of TSV rows.
Sort TSV Rows
Sort values in a TSV rows.
Count TSV Columns
Find how many columns there are in the given TSV data.
Count TSV Rows
Find how many rows there are in the given TSV data.
Count TSV Entries
Find how many total entries there are in a TSV file.
Color a TSV File
Add colors to TSV data for easy visual overview of the file.
Add Errors to TSV
Create random errors in a TSV file for fuzz testing.
Create a Custom TSV
Generate a custom TSV with n rows and m columns.
Open a TSV File
Open a TSV file directly in your browser.
Subscribe!
Never miss an update
Cool!
Notifications
We'll let you know when we add this tool
Cool!
