By Debmedia Technologies LLP · Kolkata, India · Updated
What Is It and When Do You Need It?
A CSV file is just text, but sorting it by hand is hard when cells hold commas or quotes. This tool sorts the rows safely.
Paste the CSV, name the column and choose the type.
How to Use This Tool
- Enter or paste your input in the box or boxes above.
- Choose the options, if there are any.
- Press the button to run the tool.
- Read the result and use the copy button where one is shown.
How the Calculation Works
The text is parsed into rows and cells with a state machine that understands quotes. The column is found by number or by matching the header name. The rows are sorted with a stable sort using text, numeric or natural comparison, then written back with quotes only where needed.
Worked Example
Sorting name,age / Bob,25 / Ann,30 / Cy,9 by age in descending order gives Ann (30), Bob (25) and Cy (9).
Common Uses
- Cleaning exports.
- Preparing data for review.
- Ranking lists.
- Putting names in order.
Tips and Common Mistakes
- Count columns from 1.
- Empty cells sort first in ascending order.
- Use the CSV validator if the file looks broken.
- Check the first result against a case you already know, so you can trust the tool for the rest.
- Nothing you type leaves your device. The work is done by your browser, so it also works with a slow connection once the page has loaded.
Related Tools
Next, you may need the CSV validator, CSV and JSON converter, JSON formatter and validator, string escape and unescape tool.
Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.
Frequently Asked Questions
Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.