Yes, you can alphabetize sheet tabs in Google Sheets, but there is no built-in command that sorts them automatically. In a browser, you can drag tabs into order by hand or run a short Google Apps Script to sort every tab by name.
Does Google Sheets have a built-in tab-sorting command?
Google Sheets does not currently provide an automatic alphabetical sort option for sheet tabs in its menus. The menus for a sheet tab let you do things such as rename, duplicate, delete, or move a sheet, but they do not include a command to sort all tabs A to Z. The same is true of sorting the rows in a sheet: that changes the order of data, not the order of the tabs.
This distinction matters because a spreadsheet file can contain many separate sheets, each with its own tab along the bottom of the browser window. Alphabetizing those tabs changes the sheets’ positions in the file. It does not sort cell contents, rename sheets, or create a separate copy of the spreadsheet.
For a few tabs, manual dragging is usually simplest. For a long list, or for a workbook that needs to be alphabetized repeatedly, an Apps Script is more practical. The script method requires permission to run and should be used by someone with editing access.
How to alphabetize tabs manually
Manual sorting works well when there are only a handful of sheets and you want to choose the exact order yourself. In Google Sheets in a web browser, find the sheet tabs at the bottom of the spreadsheet and drag a tab left or right to its new position. Release it when the insertion marker appears where you want the tab to go.
For a large workbook, it can be easier to move tabs in sequence than to repeatedly drag them across the full tab bar. Decide on the desired order first, then place the first sheet at the far left, the second immediately after it, and continue through the list. If a tab is out of view, use the tab navigation controls to reach it or use the tab’s context menu to move it toward an end of the tab row, where available.
Dragging is a one-time change. If someone adds a new sheet later, Google Sheets will not insert it automatically into the right alphabetical position. You will need to move it yourself or run the script again.
Alphabetize tabs with Google Apps Script
Apps Script can sort sheet objects by their names and then set their positions in the spreadsheet. The example below sorts without regard to upper- or lowercase letters and treats numbers naturally, so “Project 2” comes before “Project 10.” It uses the browser’s Apps Script editor and changes tab order only; it does not change sheet names or cell data.
function alphabetizeSheetTabs() {
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
const sheets = spreadsheet.getSheets();
sheets.sort((a, b) =>
a.getName().localeCompare(b.getName(), undefined, {
sensitivity: 'base',
numeric: true
})
);
sheets.forEach((sheet, index) => sheet.setIndex(index + 1));
}
The sort uses the spreadsheet’s sheet names as its keys. For example, if the tabs are named “Summary,” “April,” and “January,” the resulting order is “April,” “January,” and “Summary.” Because the comparison is case-insensitive, names that differ only by capitalization are treated as equivalent for sorting; their relative order may depend on their prior positions. Alphabetical treatment of accented characters can also vary with locale.
How to run the script safely
-
Open the spreadsheet in a desktop browser and, if the tab order is important, make a copy first. This gives you a simple fallback if the result is not what you intended.
-
Choose Extensions > Apps Script. A script editor opens in a separate browser tab. In a new project, remove any sample function and paste in the code above. If the project already contains code, add the function without deleting unrelated functions.
-
Save the project, then select
alphabetizeSheetTabsas the function to run and click Run. The first time, Google may ask you to authorize the script. Review the requested access and proceed only if you are comfortable allowing the script to work with the spreadsheet. -
Return to the spreadsheet and check the tabs. If you add, rename, or remove sheets later, run the function again when you want to restore alphabetical order.
Running the function changes the order of the sheet tabs in the current spreadsheet. It is not a formula that updates continuously, and changing the tab order is not something to count on undoing with the spreadsheet’s ordinary editing history. Keep a copy before running code if the workbook is important. You can also remove the script project or simply stop running the function; the spreadsheet does not need the script in order to keep its current tab order.
What the sort changes—and what it does not
Moving sheets changes their visual arrangement, not their contents. A formula that refers to a sheet by name, such as a reference to a cell on a tab named “Budget,” continues to refer to that named sheet after it moves. Reordering does not alphabetize rows, alter values, or rename a tab. It also does not decide which sheet should be the first page people see; it merely places sheets in name order.
The script works on the sheets returned by getSheets(), which includes the spreadsheet’s sheet tabs whether or not a sheet is hidden. Hidden sheets remain hidden; the script does not unhide them. Their positions are still part of the overall sheet order, so the visible tabs may appear to have gaps in the alphabetical sequence if hidden sheets fall between them.
This can be useful for workbooks with tabs such as “2024,” “2025,” “Archive,” and “Overview,” but a strict alphabetic order may not be the most useful order for every team. A front-page dashboard, a current-period sheet, or an instructions tab may be more useful at the beginning even if its name would sort elsewhere.
Common problems and choices to consider
-
The code runs but the order looks unexpected: Check the actual tab names, including spaces, punctuation, and numbers. Alphabetizing uses names, not the content inside each sheet. A name beginning with a symbol or a date formatted differently from other dates may land in a surprising place.
-
A sheet seems to be missing from the visible order: It may be hidden. The script includes hidden sheets in the ordering, but it does not reveal them. Check the spreadsheet’s hidden-sheet controls if you need to inspect or unhide one.
-
You cannot open the Apps Script editor or run the function: You may not have edit permission, or your organization may restrict Apps Script. Ask the file owner or administrator about access. In that situation, manually moving tabs may be the available option.
-
The sort puts a special tab in the middle: A name such as “!Read me” sorts according to its punctuation, not according to its purpose. Rename it with a consistent prefix, or move it manually after sorting if it should stay first.
-
You want a different order for dates or numbered periods: Alphabetical order follows names, not necessarily calendar or numeric meaning. For instance, month names sort alphabetically rather than January through December. Use year-month names such as “2026-01” and “2026-02” for chronological sorting, or retain a manual order when the naming scheme does not sort the way people expect.
When to choose manual sorting or a script
Manual sorting is a good choice when the tab order is intentionally curated, only a few tabs need moving, or scripts are blocked by workplace policy. It also makes it straightforward to keep a dashboard or “Start here” sheet at the front while arranging the remaining tabs as you prefer.
Use the script when the workbook has many tabs, when new tabs are added often, or when collaborators agree that all sheets should follow one naming-based order. The script is repeatable, but it does not run automatically when a tab is added. You must run it again, or arrange for a spreadsheet editor to run it when needed. A time-based trigger is usually not necessary for an occasional tidy-up and adds setup and permission considerations.
For ongoing work, naming conventions can reduce the need to reorder tabs. Consistent prefixes such as “01 Overview,” “02 Data,” and “03 Archive” keep related sheets together and put important tabs where readers expect them. Prefixes also make the intended order clearer than relying on ambiguous names like “Final,” “Final copy,” and “Old.”
Frequently Asked Questions
Can I sort Google Sheets tabs A to Z without a script?
Yes, but only by moving them manually. Drag each tab into the desired position. Google Sheets does not have a built-in A-to-Z command for sheet tabs.
Does sorting tabs alphabetically sort the data inside them?
No. Tab sorting only changes the sheets’ positions in the spreadsheet. To sort rows or columns, select the data and use the relevant data-sorting tools separately.
Will the Apps Script rename or delete any sheets?
No. The example compares each sheet’s existing name and changes its index, which is its position among the tabs. It does not rename or delete sheets or edit their cells.
Will hidden sheets be alphabetized too?
Yes. The script obtains all sheets in the spreadsheet, including hidden ones, and sets their positions. It does not make hidden sheets visible.
Can I keep one tab first and alphabetize the rest?
Yes, but the sample function sorts every sheet. You can move a preferred tab manually after running it, or adapt the script to exclude that tab from the alphabetical group. If you edit code, make a copy first and confirm the result before relying on it.
Bottom line
You can alphabetize Google Sheets tabs, but there is no built-in one-click sort for them. Drag tabs by hand for a small workbook; use Apps Script when you want a repeatable alphabetical sort across many sheets. Choose a naming convention and an order that help people navigate, and remember that the script must be run again after the tab names or workbook contents change.
Related
- Outlook Excel Sheet: Create a Data Entry Form in Excel
- How to Copy an Excel File to Word
- Insert Outlook Email Into Excel: Methods That Work
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Track Changes in Word on Mac: Review and Accept EditsTo track changes in Word on a Mac, open your document, select Review > Track Changes, and then…
- How to Make a Flowchart in Microsoft WordTo make a flowchart in Word, choose Insert > Shapes, add flowchart shapes to the page, and connect…
- How to Freeze the First Two Columns in ExcelTo keep columns A and B visible while you scroll across a worksheet in Excel for Microsoft 365…
- Gmail Rules: How to Create and Manage Filters Like OutlookYes. Gmail can automatically sort, label, forward, archive, delete, or otherwise handle messages using filters—the feature that plays…
- Create a Brochure in Microsoft Word: Layout, Steps and TipsTo create a brochure in Microsoft Word, start with a brochure template or set up a blank document…
- Wedding Budget Spreadsheet: Free Google Sheets SetupYes. You can make a wedding budget spreadsheet for free in Google Sheets with a personal Google account,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.