FREE ONLINE TABLE TOOL

Sort CSV

Order records without rewriting their values. Sort whole records by multiple fields without rewriting values.

No account neededFiles stay on your deviceOriginals preserved

Start with your data

Import data, confirm the rules, review the result, and export a new copy.

◈ Processed on your device
1Import data—2Configure—3Review—4Export

Drop your table here

Drag and drop a CSV, TSV, or delimited text file

UTF-8 · Up to 10 MB per file

Start with your data

File content is processed in your browser, without uploading it.
Kept in page memory · Continue across tools · Refreshing or closing clears the sessionCSV / TSV · UTF-8
Sample library Products · Supplier files · System imports

Clear this session?

Imported data, steps, and results will be released. Export any needed copies first. Original files are unaffected.

A CLEARER WAY TO WORK

Order records without rewriting their values.

Explore the scope, review process, and results in three practical scenes.

01 / SCOPE & PURPOSE

Set a clear multi-field order

Sort by category and then amount, or organize by identifier. Add fields in order and choose the direction for each one.

Illustrative scene for Sort CSV: Set a clear multi-field order
Illustrative scene
02 / RULES & REVIEW

Move complete records together

Sorting changes row order while names, identifiers, and values stay together. Equal keys keep a stable order, and original text is preserved.

Illustrative scene for Sort CSV: Move complete records together
Illustrative scene
03 / RESULTS & NEXT STEPS

Choose how values are interpreted

Text order and numeric order differ. Choose the right interpretation for each field, review invalid-value feedback, and export the ordered result.

Illustrative scene for Sort CSV: Choose how values are interpreted
Illustrative scene
BUILT FOR YOUR TABLES

What Sort CSV can do

Explore the available features and choose what your table needs next.

Multiple sort priorities

Add multiple fields, with earlier rules taking priority.

Use in the tool

Ascending or descending

Choose a sort direction independently for each field.

Use in the tool

Text or numeric mode

Choose comparison semantics without rewriting the original values.

Use in the tool

Stable ordering

Preserve relative record order when sort keys compare equally.

Use in the tool

Whole rows move together

Always move complete records so columns do not become misaligned.

Use in the tool

Full-result export

Sort the complete dataset; paginated previews do not limit the operation.

Use in the tool
HOW IT WORKS

Three steps to a reviewed result

Confirm the input, inspect changes, and save the output you need.

01

Import and confirm the source

Choose a CSV or TSV file, or paste a table. Check the delimiter, headers, and preview before confirming the full import.

  • Content stays in your browser
  • Source files remain intact
Go to the input area
02

Set the rules, run, and review

Add sort fields in priority order, select text or numeric interpretation, and choose ascending or descending order. Run the sort and review the full result.

  • Process the full dataset
  • Review results and sources
Set processing rules
03

Choose a scope and export a copy

Choose the result or report and CSV or TSV format. Review the export summary and protection count, then confirm download or copy.

  • Read-back verification before export
  • Choose the scope explicitly
Continue in the tool
Need detailed rules, examples, and limits?Read the full guide

Sort whole CSV records without rewriting their values

Sorting a CSV should move complete records together. A price must remain attached to its product code, and a description must remain attached to its identifier. TableWorkbench sorts rows using one or more selected columns, retains stable order for ties, and leaves stored cell text unchanged. You can choose text or exact decimal interpretation separately for each sort field. That choice affects comparison order rather than converting the output values into a different representation.

Import and confirm the file before choosing a sort. Check that the header is correctly recognized and that quoted delimiters or multiline cells have not been split into separate fields. Identifiers are read as strings, including leading zeros and long sequences of digits. Once the columns are confirmed, add a sort field and select its direction. Add more fields when the first comparison can tie and another field should determine the order within those ties.

Make priority explicit

Sort fields are evaluated in their displayed order. The first field decides whenever its two compared values differ. The second field matters only when the first is equal, and later fields resolve remaining ties. Use the up and down controls to change this priority. Sorting first by Region and then by Price groups regions before ordering prices within each region; reversing those fields gives a different global sequence and can interleave regions.

When all selected comparisons tie, the earlier relative order is preserved. This stable behavior is useful when the incoming sequence already has meaning, such as the order of records appended from suppliers. It also makes repeated runs predictable. Stability does not establish which tied record is authoritative, and sorting does not remove duplicates. If you later use Keep first or Keep last deduplication, remember that changing order can change which occurrence that separate policy retains.

Text order uses an explicit locale

Text mode compares strings using the selected sorting locale. The locale is a data-processing choice independent of the interface language. Switching the site from English to Simplified Chinese does not change the selected text ordering rule. This avoids unexpectedly reordering a dataset merely because another reviewer prefers a different language for buttons and help. Choose a locale appropriate for the text you need to arrange and inspect representative accented or non-Latin values.

Text mode is not numeric mode. A sequence of digit characters may be ordered lexically rather than by quantity, which can put 10 before 2. It is often appropriate for codes where every character is part of an identifier. Leading zeros remain meaningful, and the tool does not remove them to create a numeric interpretation automatically. Mixed-language text can have ordering subtleties, so keep the selected locale with any explanation of the result.

Exact decimal sorting preserves long values

Numeric mode accepts decimal text using a dot as the decimal separator and no thousands separators. Optional signs and fractional parts are supported. Values that do not conform to that syntax block the operation with a source location and column, instead of being silently treated as zero. Dates, currency symbols, grouped numbers, scientific notation, and locale-specific comma decimals are not guessed into numeric values by this operation.

Comparisons use decimal arithmetic rather than converting all values through ordinary floating-point numbers. This lets neighboring long integers such as 9007199254740992 and 9007199254740993 retain their intended order. The original strings still appear in the output. A numeric comparison can treat 2 and 2.00 as equal for ordering while keeping each spelling intact. Stable tie handling then preserves their previous relative order unless a later selected field resolves the tie.

Place empty values deliberately

Empty values can be placed first or last. This applies independently of whether the nonempty values are ascending or descending, so the position of missing information remains an explicit choice. A cell containing the text zero is not empty. The strings NULL and N/A are also not empty, and a whitespace-only string is not automatically discarded. If those are intended missing markers, prepare the field through a visible cleaner rule before applying numeric sorting.

A failed numeric parse leaves the source and previous accepted workflow state intact. Inspect the reported value and decide whether the sort should be textual or whether a validated conversion is required. Removing a currency symbol or replacing a decimal separator can change meaning when the source conventions are mixed. The sorter deliberately avoids doing that cleanup on your behalf. Keep type interpretation and text rewriting as distinct decisions.

A product-priority example

Take five records with codes 001 through 005 and quantity values 9007199254740993, 9007199254740992, 2, 10, and 2. Choose quantity as an ascending numeric field. The expected code order is 003, 005, 004, 002, 001. The two quantity-two records keep their previous relative order. The very large quantities remain distinct, and both the codes and quantity strings are exported exactly as stored unless you enable a separate export-protection transformation.

Add a second ascending text sort on SKU if you want the two equal quantities ordered by code under an explicit rule. In this example the visible outcome happens to be the same, but the policy is now different for another input order. Run and review the full result, then apply it to the workflow. Undo restores the prior sequence by recomputing accepted steps from the preserved source. No cells are detached from their records during either direction of that operation.

Frequently asked questions

How can I sort by two columns and keep each row together?

Set the sort fields in priority order and choose the appropriate text or numeric comparison for each. Sorting moves whole records, so values from the same row stay together. Numeric ordering changes the comparison, not the stored spelling of the value. When all selected sort values tie, the stable sort retains their previous relative order.

Why does text sorting put 10 before 2?

Text mode compares character sequences under the selected locale, rather than interpreting them as quantities. Choose numeric mode for a field whose values are decimal numbers. Keep text mode for identifiers whose spelling is meaningful. The workbench does not infer that a column containing mostly digits must be numeric.

Will numeric sorting remove zeros from 001?

No. Numeric interpretation is used only to determine order. The stored value remains the string 001 and is serialized that way. A receiving spreadsheet may still infer a number when opening the exported CSV directly. Import the identifier column as text there when preserving the displayed zeros is important.

What happens when two records have the same sort values?

They keep their previous relative order because the sort is stable. You can add another field when you need an explicit tie-breaker. Stability does not deduplicate or combine the records. Their complete contents and provenance remain available for later inspection or a separate duplicate-handling step.

Can I sort comma-decimal amounts or dates?

Not with implicit interpretation. Numeric mode currently requires a dot decimal separator and does not parse dates. A date string can be sorted as text, but that order only corresponds to chronological order for suitable consistent formats. Define and validate any conversion separately instead of relying on the interface language to guess it.

Why do I see formula protection in a sorting export?

Export safety is independent of sorting. A legitimate negative value begins with a character that spreadsheet programs may treat as a formula prefix, so the conservative protected mode can add an apostrophe. The confirmation shows the affected count. Choose raw text only when you understand the destination and want the original characters without that export transformation.

Can I restore the order I had before sorting?

Yes. An applied sort is a reversible workflow step. Undo restores the preceding table and redo restores the sort when available. If you need the original file's order after several other applied steps, review the ordered workflow and undo to that point. Downloaded copies remain separate files; changing the memory session does not modify those downloads.

Ready to work with your table?

Start with a sample to learn the workflow, then process your own files.