Sort folders by size in Windows: 4 ways
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
Windows does not let you sort folders by size in File Explorer directly—the Size column is blank for folders. To see which folders take up the most space, you need to use a third-party disk space analyzer or the command line. This article explains four reliable methods, from built-in tools to free software, and how to interpret the results.
Why Windows can’t sort folders by size
File Explorer’s Size column shows the size of individual files, not folders. When you select a folder, Windows does not recursively sum the sizes of all files inside it—that would require scanning every subfolder and file, which can be slow on large drives. Instead, Explorer relies on the NTFS file system’s stored metadata for files, but folder sizes are not precomputed. So the Size column simply shows a dash for folders, and sorting by that column does nothing.
This is by design: calculating folder sizes on demand would cause noticeable delays every time you open a folder. Third-party tools work around this by scanning the entire directory tree once and caching the results.
Method 1: Use a disk space analyzer (easiest)
Disk space analyzers scan your drive and display folder sizes as a visual map or a sorted list. They are the most practical way to find large folders. Popular free options include:
- WinDirStat – shows a treemap of colored rectangles, each representing a file; folder sizes are listed in a tree view.
- WizTree – uses the NTFS Master File Table (MFT) to scan extremely fast, often in seconds.
- TreeSize Free – offers a clean list view with sorting by size.
These tools are safe to use—they only read file metadata, not modify anything. After scanning, you can sort the folder list by size descending and immediately see which folders are largest.
Method 2: Use PowerShell (built-in, no extra software)
If you prefer not to install anything, PowerShell can calculate folder sizes with a simple script. Open PowerShell (as administrator if you need to access protected folders) and run:
Get-ChildItem -Path "C:\YourFolder" -Directory | ForEach-Object {
$size = (Get-ChildItem $_.FullName -Recurse -File | Measure-Object -Property Length -Sum).Sum
[PSCustomObject]@{ Folder = $_.FullName; SizeMB = [math]::Round($size / 1MB, 2) }
} | Sort-Object SizeMB -Descending | Format-Table -AutoSize
This lists each subfolder and its size in megabytes, sorted from largest to smallest. The script can be slow on large folders because it scans every file. For a single folder’s total size, use:
(Get-ChildItem -Path "C:\YourFolder" -Recurse -File | Measure-Object -Property Length -Sum).Sum / 1GB
This returns the size in gigabytes. Note that PowerShell measures logical file size, not actual disk usage (which includes cluster slack and compression).
Method 3: Use the command prompt (dir)
The classic dir command can show the total size of all files in a folder, but not per subfolder. To get a total for the current folder and its subfolders, run:
dir /s
At the end of the output, Windows displays the total number of files and the total size. To list subfolder sizes, you’d need a batch script or a tool like du (from GNU Coreutils, not built-in). This method is less convenient than PowerShell but works in any command prompt.
Method 4: Use File Explorer’s “Details” view with a workaround
There is no direct way, but you can temporarily move folders to a different drive to see their size in the destination’s properties. That is impractical. A better workaround is to use the “Folder Size” column in third-party file managers like XYplorer or Total Commander, which calculate folder sizes on demand. These are paid tools, but they integrate with Windows Explorer.
How to choose the right method
Your choice depends on how often you need this and how large your drive is:
- One-time check – use PowerShell or a portable disk analyzer.
- Frequent use – install a disk analyzer that remembers scan results.
- Very large drives (TB) – WizTree is fastest because it reads the MFT.
- No admin rights – portable apps like WinDirStat Portable work without installation.
All methods give you the logical size of files. Actual disk usage may be higher due to cluster size and lower if compression or deduplication is enabled.
Common pitfalls and tips
- Hidden and system files – PowerShell’s
Get-ChildItemexcludes hidden files by default. Add-Forceto include them. - Access denied errors – Some folders (e.g., System Volume Information) are protected. Run as administrator or exclude them.
- Symbolic links – Scanners may follow junctions and count the same data twice. Most tools let you skip junctions.
- Sorting by size in Explorer after scanning – Some analyzers can export a list that you can open in Excel and sort, but Explorer itself still won’t sort folders by size.
Frequently Asked Questions
Can I sort folders by size in Windows 11?
No, Windows 11 File Explorer still does not support sorting folders by size. The Size column remains empty for folders. You need third-party tools or PowerShell.
Why does the Size column show a dash for folders?
Because Windows does not store folder sizes in the file system metadata. Calculating them on the fly would slow down every folder view, so Explorer simply omits the value.
Is it safe to use disk space analyzers?
Yes, they only read file metadata and do not modify or delete anything. Always download from the official website to avoid malicious copies.
What is the fastest way to find large folders?
WizTree is generally the fastest because it reads the NTFS Master File Table directly, bypassing the need to scan every file. It can scan a multi-terabyte drive in seconds.
Can I sort folders by size in Command Prompt?
Not directly. The dir command shows total size for the current folder and subfolders, but not per subfolder. You’d need a script or a third-party tool.
Does folder size include hidden files?
By default, no. In PowerShell, add the -Force parameter to include hidden and system files. Most disk analyzers have an option to include them.
Related
Formula used
in t | Folder path | - | C:\Users\YourName | 0 out size | Folder size (GB) | GB | 0 | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.