fsize
fsize is a native Windows command-line utility for measuring files and directories. In addition to reporting a total size, it can rank the entries that are consuming the most storage.
Licensed under the MIT License.
Examples
Measure a directory:
fsize "C:\Users\Wozzardman\Downloads"
Show its 20 largest immediate files or directories:
fsize --top 20 "C:\Users\Wozzardman\Downloads"
Look up to three levels deep and show only directories:
fsize --top 20 --depth 3 --type dirs "C:\Users\Wozzardman"
Find the largest files up to five levels deep and parse the result in PowerShell:
$result = fsize --top 50 --depth 5 --type files --json "D:\"
$result | ConvertFrom-Json
Options
Usage: fsize [options]
-b, --bytes Output raw bytes only
-v, --verbose Show file and directory counts
-q, --quiet Hide the progress display
-n, --top [N] Show the N largest entries (default: 10)
-d, --depth Rank entries up to N levels below the root
--type Rank all, files, or dirs (default: all)
--json Output structured JSON and disable progress
--no-color Disable colored console output
--show-errors List unreadable paths and Windows error details
--version Show the installed fsize version
-h, --help Show help
--depth and --type automatically enable ranking with the default top count. Ranking defaults to --depth 1, so it compares only the root directory's immediate children. With a deeper scan, both a directory and one of its descendants can appear in the results; their recursive sizes intentionally overlap.
Text output for --depth 2 and deeper is rendered as a tree. Global rank numbers still indicate size order, while entries are grouped beneath their parent directories. When a parent is outside the top results or excluded by --type, it is shown as an unranked context row with blank size and share columns. JSON output remains a flat, size-sorted list.
Interactive ranking output uses separate colors for ranks, sizes, percentages, entry types, and paths. Size and percentage colors form a simple heat scale so the largest storage consumers stand out. Colors are automatically disabled for JSON and redirected output; use --no-color to disable them in a terminal as well.
Directory junctions and other reparse-point directories are not followed, which prevents traversal loops. If a path cannot be read, the normal text output reports how many paths were skipped. Use --show-errors for Windows error codes and messages. JSON output includes these details in its errors array.
Build
From an x64 Visual Studio Developer Command Prompt:
cl /nologo /std:c++17 /EHsc /W4 /O2 /MT /utf-8 fsize.cpp /Fe:fsize.exe
To compile and assemble the distributable ZIP, run:
.\packaging\Build-Release.ps1
The release build creates both the complete friend-to-friend package and a minimal *-portable.zip asset intended for WinGet's portable installer flow.