How to Keep Folders on Top in Finder on Mac When Sorting Files

One of the most noticeable differences for users transitioning from Windows to macOS—or for anyone who manages dense directory trees with hundreds of loose documents—is how Apple Finder sorts directory contents. By default, when sorting files alphabetically by Name in Finder, macOS intermixes folders and files together in a single continuous alphabetical list. If you prefer to have all folders grouped neatly at the very top of the window with standalone documents listed underneath, you can enable a native Finder preference across all windows and the desktop.

Why Does Finder Mix Files and Folders by Default?

Historically, classic Mac OS treated all filesystem objects as egalitarian documents and bundles, sorting strictly by literal alphanumeric filename strings. In contrast, Windows File Explorer has always pinned directories above files. While experienced Mac users grew accustomed to this unified sorting style, macOS now provides dedicated preferences that allow you to group folders on top across Finder windows, open/save file dialogue pickers, and the macOS desktop canvas.

Method 1: Enabling “Keep Folders on Top” in Finder Windows

To configure Finder windows to group directories at the top of the list:

  1. Click on the Finder icon in your Mac Dock, or click on the empty desktop canvas to make Finder the active application.
  2. In the menu bar at the top of the screen, click Finder and select Settings (or press Cmd + ,).
  3. In the Finder Settings window, click on the Advanced tab (represented by a gear icon).
  4. Locate the section titled Keep folders on top:.
  5. Check the box labelled In windows when sorting by name.

The moment you check this box, every active Finder window operating in List, Icon, Column, or Gallery view instantly reorganises. All folders will be pinned to the top of the window in alphabetical order, followed by your documents, images, and applications.

Method 2: Keeping Folders on Top on the macOS Desktop

If you also store files and working project directories directly on your desktop and want folders grouped together:

  1. Open Finder > Settings > Advanced as described above.
  2. Under the Keep folders on top section, also check the second box labelled On Desktop.
  3. Click empty space on your desktop, then click View in the top menu bar > Sort By > Name.

Your desktop icons will now arrange with directory folders occupying the primary slots, keeping loose files cleanly separated.

Alternative Method: Using Finder “Group By Kind”

If you want even deeper organisational structure where files are categorised into distinct sections (such as Folders, PDF Documents, Images, and Spreadsheets):

  1. Open any Finder window.
  2. Right-click any empty whitespace inside the window and select Use Groups (or press Ctrl + Cmd + 1).
  3. Right-click again, hover over Group By, and choose Kind.

Finder divides the entire window into labelled visual compartments, with the Folders group permanently locked at the very top.

Get the best tech tips delivered straight to your inbox.

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