How to Sort Tables in Google Docs Ascending or Descending by Column

Working with structured information in Google Docs frequently requires reorganising data into logical alphabetical or numerical sequences. While users previously had to copy tables into Google Sheets to perform basic sorting before pasting them back, Google Docs now features built-in table sorting capabilities. This native functionality allows you to sort table rows in ascending or descending order based on any selected column, preserving cell formatting, text styling, and document layout without third-party add-ons.

Preparing Your Table and Pinning Header Rows

Before executing a sort, it is critical to ensure that your column labels remain firmly fixed at the top of the table. Without designating a header row, Google Docs treats every row as raw data, causing your title labels to be sorted alongside your entries.

  1. Open your document in Google Docs.
  2. Place your text cursor anywhere inside the top row containing your column headings.
  3. Right-click the row and select Pin header row, or click the small pin icon that appears in the left margin next to the row.
  4. Optionally, open Format > Table > Table properties from the top menu, expand the Row section in the right sidebar, and verify that Pin header row(s) is enabled.

Pinning the header guarantees that sorting operations only reorder the body rows beneath the heading, keeping your data categories permanently visible across multi-page documents.

Sorting Tables Using the Quick Hover Handle

The fastest way to sort tabular data in Google Docs is by using the contextual column hover handle:

  1. Move your mouse pointer over the top border of the column you want to sort by.
  2. A small sort icon featuring an up-and-down arrow appears above the column header.
  3. Click the sort button to reveal sorting choices:
    • Sort table ascending (A to Z or 0 to 9): Reorders rows in alphabetical order or smallest-to-largest numeric sequence.
    • Sort table descending (Z to A or 9 to 0): Reorders rows in reverse alphabetical order or largest-to-smallest numeric sequence.
  4. Select your preferred direction. Google Docs immediately shifts the entire row content across all columns to maintain data consistency.

Sorting via the Right-Click Context Menu

If you prefer using keyboard navigation or contextual menus rather than hovering over column margins, you can trigger sorting directly from any cell:

  1. Right-click inside any cell located within the column you wish to sort.
  2. Hover over Sort table in the context menu.
  3. Choose either Sort table ascending or Sort table descending.
  4. Inspect the resulting order to confirm all corresponding columns shifted together correctly.

Google Docs Table Sorting Behaviour and Characteristics

The following table outlines how different data types and configurations behave during native sorting in Google Docs:

Data Type / Element Sorting Order (Ascending) Considerations & Limitations
Plain Text Alphabetical (A to Z) Case-insensitive; leading whitespace can cause unexpected ordering.
Numeric Values Smallest to Largest (0 to 9) Cells containing currency symbols or letters are treated as alphanumeric text.
Dates Chronological (Oldest to Newest) Requires consistent date formatting (e.g., YYYY-MM-DD) to sort correctly.
Pinned Header Rows Remains Fixed at Top Unpinned rows will be mixed into sorted data if not marked before sorting.
Merged Cells Unsupported Columns containing horizontally or vertically merged cells cannot be sorted.

Handling Merged Cells and Sorting Limitations

While native table sorting in Google Docs handles most routine tasks seamlessly, specific structural conditions will disable or distort sort functions:

  • Merged Cells Restriction: If your table contains cells merged across multiple columns or multiple rows, Google Docs greys out the sort options. To resolve this, right-click the merged cell and select Unmerge cells before sorting.
  • Multi-Level Sorting: Google Docs currently supports single-column sorting. If you need secondary and tertiary sorting criteria (such as sorting by Department first, then by Surname), you can achieve this by sorting by the secondary column first, followed immediately by sorting the primary column. Alternatively, link a Google Sheets spreadsheet into your document using Insert > Chart or copy-pasting as a linked table.
  • Mixed Formatting: If a column contains both numbers and text (for example, invoice codes like #102 and plain numbers like 98), Google Docs applies standard ASCII sorting, placing symbols and numbers ahead of alphabetical characters.

Restoring Original Order with Revision History

If a sort produces unintended results or disrupts a curated sequence, you have several quick recovery methods:

  1. Immediately press Ctrl + Z (Windows/ChromeOS) or Command + Z (macOS) to undo the sort action.
  2. If the document was closed or edited extensively after sorting, go to File > Version history > See version history.
  3. Locate the timestamp preceding the sort operation in the right panel and click Restore this version.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.