Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

Sort CSV Columns

Reorder CSV columns by dragging or specifying column order. Rearrange columns alphabetically or custom. 100% client-side.

Your files never leave your browser
Columns:Paste CSV to see columns
CSV Input0 chars, 0 lines
Reordered Output0 chars, 0 lines
Error:
    Ready·

    Rearrange CSV columns by dragging headers, typing a custom order like 3,1,2, or sorting A–Z with one click. Handles quoted fields, embedded commas, and large files without breaking a sweat. And everything runs in your browser. Nothing gets uploaded.

    How It Works

    Paste CSV
    →
    Drag or Set Order
    →
    Get Sorted CSV

    The parser reads your first row as headers, then maps every data row to those headers. When you rearrange column order — whether by dragging tags, clicking A-Z/Z-A, or typing something like 3,1,2 — it rebuilds each row with fields in the new position. Quoted fields with commas or line breaks inside them are handled correctly per RFC 4180.

    Examples

    Reordering an export from a contact database

    Your CRM spits out columns in a weird order. You need name first, then email, then company.

    INPUT
    company,email,phone,name Acme Inc,[email protected],555-1234,Jo Smith Beta LLC,[email protected],555-5678,Sam Lee
    OUTPUT
    name,email,company,phone Jo Smith,[email protected],Acme Inc,555-1234 Sam Lee,[email protected],Beta LLC,555-5678

    Alphabetical sort on a wide spreadsheet

    A 15-column product catalog with columns in no particular order. Click A-Z and every column snaps into alphabetical position.

    INPUT
    price,sku,name,category 29.99,A100,Widget,Tools 14.50,B203,Gadget,Electronics
    OUTPUT
    category,name,price,sku Tools,Widget,29.99,A100 Electronics,Gadget,14.50,B203

    Dropping unwanted columns during reorder

    You only need three out of six columns for your import template. Type just the column names you want — the rest get excluded automatically.

    INPUT
    id,name,email,phone,address,notes 1,Jo,[email protected],555-0001,123 Main,VIP 2,Sam,[email protected],555-0002,456 Oak,New
    OUTPUT (order: name,email,phone)
    name,email,phone Jo,[email protected],555-0001 Sam,[email protected],555-0002

    Who Uses This

    👨‍💻 Developers

    Reorder CSV columns to match a database schema or API import spec before loading data.

    📊 Data Analysts

    Clean up messy exports so the most important fields — dates, IDs, metrics — come first.

    📈 Marketers

    Rearrange campaign performance CSVs so the columns line up with their reporting template.

    🧑‍🏫 Students

    Reorganize lab data exports before submitting assignments that require a specific column layout.

    Common Mistakes

    Typing column names with wrong capitalization

    Column names are case-sensitive. If your header says “Email” and you type “email” in the custom order field, it won’t match. Copy the exact header text or use column numbers instead.

    Pasting tab-separated data instead of comma-separated

    If you copy from Excel, you might get TSV (tabs between values) rather than CSV. The tool expects commas as delimiters. Save as .csv from Excel first, or convert tabs to commas.

    Forgetting the header row

    The first row is treated as column headers. If your data doesn’t have headers, the tool will treat the first data row as header names. Add a header row before pasting to avoid jumbled results.

    Technical Details

    Frequently Asked Questions

    How do I rearrange columns in a CSV file?

    Paste your CSV here and drag the column header tags into the order you want. You can also type column names or numbers (like 3,1,2) into the custom order field and click Reorder. The output updates immediately.

    Can I remove columns I don’t need at the same time?

    Yes. If you type only the columns you want in the custom order field, any columns you leave out won’t appear in the output. It is a reorder and filter in one step.

    Does this work with large CSV files?

    It handles files with thousands of rows without problems. Since processing happens in your browser, the only real limit is your device’s available memory. A file with 50,000 rows and 20 columns sorts in about a second on most machines.

    Is my CSV data safe? Does it get uploaded?

    Your data stays in the browser tab. Nothing is sent to any server. Once you close or refresh the page, the data is gone — there’s no storage, no logging, no tracking.

    What if my CSV has commas inside quoted fields?

    The parser follows RFC 4180 rules, so quoted fields are handled correctly. A value like “Portland, OR” won’t get split into two columns. Same goes for fields with line breaks or escaped quotes inside them.

    Share: