How to Keep Folders on Top When Sorting Files on a Mac

On Windows, File Explorer lists folders above files: folders are where you go next, files are what you open, and keeping them apart makes a long folder quicker to scan. In the Finder, folders and files can share one alphabetical list, so a spreadsheet called Budget sits above a folder called Clients. One setting changes that, within a limit.
In the Finder, choose Finder › Settings, click Advanced, and under Keep folders on top, check In windows when sorting by name. It applies to every Finder window, and only while that window is sorted by name. In Folia Files, Folders on Top is on from the start and works with every sort: name, date, size or kind, ascending or descending. You can turn it off in one pane while the others keep it, and save the choice for a folder.

Keep folders on top in the Finder
Turn the option on
- In the Finder, choose Finder › Settings, or press ⌘,.
- Click Advanced.
- Under Keep folders on top, check In windows when sorting by name. Check On Desktop as well if you want the same order for the icons on your desktop.
What it doesn't do
- It only works when sorting by name. The label says so: sort a window by date or by size, and folders are mixed with the files again.
- It's one setting for all windows. A folder can't have a choice of its own.
- Terminal doesn't go further. The checkbox is stored as
_FXSortFoldersFirstin the Finder's preferences. Typingdefaults write com.apple.finder _FXSortFoldersFirst -bool true, thenkillall Finder, does exactly what the checkbox does, with the same limit.
Keep folders on top in Folia Files
Folia Files is a file manager for the Mac, with panes side by side. Its Folders on Top option is on from the start and goes further than the Finder's in three ways: it works with every sort, it belongs to each pane, and it can be saved for a folder. It leaves the Finder's own setting alone: each app keeps its order.
Whatever the sort
Folders stay above files with every sort: Name, Date Modified, Date Created, Date Added, Size and Kind, Ascending or Descending. The folders are sorted first, then the files, by the same rule:
- sort Downloads by date added, newest first, and you get the newest folders, then the newest files;
- sort by size and the biggest folder comes first, ahead of the biggest file, since the Detailed List measures every folder (see how to show folder sizes in list view);
- sort by name from Z to A, and the folders still come first, from Z to A;
- sort by kind, and the folders come first, then the files by type, so the PDFs end up together, and the spreadsheets too.
Symbolic links to folders count as folders. Apps and other packages, which open instead of showing what's inside, stay with the files.
Where to switch it
- the two-arrow button in a pane's header: Folders on Top ends the Sort By list, after Ascending and Descending;
- a right-click on an empty part of the folder: Sort By › Folders on Top;
- the menu bar: View › Folders on Top;
- the gear in the pane's header: in its View section, right below the summary of the pane's view.

That summary also tells you which order a pane uses: it ends with “folders mixed with files” when the option is off.
The change applies to that pane only, so two panes side by side can differ: folders on top in Documents on the left, folders and files mixed in Downloads on the right. Each pane keeps its choice from folder to folder, unless a folder has a saved view of its own.
In every view, and with groups
The order holds in every view that lists files: List, Detailed List, Icons, Gallery, Columns (in each column), Tree (at each level) and Branches (in each card, even one you sorted on its own).

With Group By › Kind, the folders' group comes first. With any other grouping, such as Date Modified or Tag, folders lead inside each group: under Today, today's folders come before today's files. Turn the option off, and the folders' group takes its alphabetical place among the kinds. Grouping itself is explained in how to group files by kind, date or size.
Save it for one folder, or for new panes
- For one folder: set the pane up, click the gear, then Save for This Folder, or Save for This Folder and Its Subfolders for a whole folder tree. Folders on Top is saved with the rest of the view: the view itself, the sort, the grouping, the icon size and hidden files. For example, save Downloads sorted by date added with folders mixed in, so that whatever arrived last is always at the top, while every other folder keeps its folders first. In a folder that already has a saved view, switching Folders on Top shows the change without saving it: a dot appears on the gear until you choose Update for This Folder.
- For new panes: in Settings › Panes, under Default view, turn Keep folders on top on or off. It changes the panes you open next, not those already open.
Folders on Top is one of the settings each pane keeps on its own, with its folder and its view: the page on panes, tabs and scenes shows the others. Coming from Windows? Here is where your other File Explorer habits went.


