Quick fix: Files showing 0 bytes in File Explorer but Properties showing “Size on disk” greater than 0 are usually OneDrive cloud-only placeholders, sparse files, or NTFS alternate data streams. For OneDrive: right-click → Always keep on this device downloads full contents. For sparse files: data exists in “allocated” ranges only; the rest is virtually zero.
You see a file with 0 bytes in the Size column but it takes up 5 MB on disk. Or the reverse: 5 MB file size but 0 bytes on disk. The mismatch confuses many users. The cause depends on file type: OneDrive placeholder, sparse file (database, VM disk), or unusual NTFS feature.
Affects: Windows 11 (and Windows 10) with NTFS.
Fix time: ~5 minutes to identify.
What causes this
NTFS separates two metrics: file size (logical bytes of content) and size on disk (physical clusters allocated). Several scenarios cause a mismatch:
- OneDrive cloud-only placeholder: file appears in folder but content lives in cloud. Size shows logical bytes; Size on disk shows 0 because content isn’t local.
- Sparse files: file marks ranges as “virtually empty” without allocating disk. VHDX virtual disks, databases use this for fast preallocation.
- NTFS compression: file shows logical size; Size on disk shows compressed size (smaller).
- Hard links / junctions: file appears in multiple folders but disk space counted only once.
Method 1: Identify file type causing the mismatch
The diagnostic step.
- Right-click the file → Properties.
- Compare:
- Size: logical file size (what apps see when reading).
- Size on disk: physical disk usage.
- Check Attributes:
- Tick A (Advanced) and look for Compressed, Sparse, or Encrypted.
- OneDrive placeholders show with cloud icon overlay in Explorer.
- For OneDrive files: check cloud icon. Hover over file. Tooltip indicates Available on this device / Online-only.
- From Terminal:
fsutil sparse queryflag filenameReturns 1 if sparse, 0 if not.
- For hard links: Terminal →
fsutil hardlink list filename. Lists all paths sharing this file content.
This tells you what category the file is in.
Method 2: For OneDrive placeholders, force local download
For files appearing online-only.
- Right-click the file (or folder) → look for OneDrive section in context menu.
- Click Always keep on this device. OneDrive downloads full content.
- Status icon changes from cloud (online-only) to green check (locally synced, always available).
- Size on disk now matches Size (or slightly larger due to clusters rounding).
- For bulk: select multiple files, right-click → Always keep on this device. Or set entire folder.
- To revert later: right-click → Free up space. File returns to cloud-only state.
- For non-OneDrive cloud sync (Google Drive, Dropbox): similar concept; check the sync app’s settings.
This is the right path for cloud sync placeholders.
Method 3: For sparse files, understand the design
For database, VM disk, or log files.
- Sparse files are intentional: apps create them to preallocate logical size without using physical space.
- Examples: VHDX/VHD virtual disks (Hyper-V), database logs, Visual Studio symbol files, some game save files.
- The file’s “size” reflects the maximum it could grow to; “size on disk” reflects what’s actually used.
- You can’t safely “defragment” or “optimize” sparse files. They’re managed by the app that created them.
- For Hyper-V VHDX with sparse:
Optimize-VHD -Path file.vhdx -Mode Fullreclaims unused space inside the VHD. - For checking how much actual data is in a sparse file:
fsutil file queryextents filenameLists allocated regions.
- To convert sparse to non-sparse (allocate full size):
fsutil sparse setflag filename 0. Caution: increases disk usage to the file’s logical size.
This is the educational answer for sparse files.
How to verify the fix worked
- For OneDrive: file shows correct size in both Size and Size on disk. Cloud icon changed to green check.
- For sparse: file’s “virtual” size reflects logical; physical disk usage stays at actual content size.
- Run
Get-Item filename | Format-List Length, *Size*in PowerShell. Length is logical size.
If none of these work
If the 0-byte issue is unexplained: Filesystem corruption: run chkdsk C: /f on the drive. CHKDSK can repair file size metadata corruption. Reparse points: junctions, symbolic links, or Microsoft App Execution Aliases appear as 0-byte files but redirect to real files. Use fsutil reparsepoint query filename to inspect. For files that should have content but show 0: file was truncated or interrupted during write. Recover from backup if available. For Word/Excel docs showing 0 bytes: open in the app — some doc formats store content in alternate data streams; if streams were stripped by virus scanner, file appears empty. Check Word’s AutoRecover folder for backup. For files on external drives: USB drive disconnect mid-write produces 0-byte stubs. Run CHKDSK on USB drive to repair.
Bottom line: Size 0 bytes with disk usage = OneDrive cloud-only placeholder or sparse file. Right-click → Always keep on this device for OneDrive. fsutil sparse queryflag identifies sparse files.