Why Some Files Show 0 Bytes But Take Space on Disk on Windows 11
🔍 WiseChecker

Why Some Files Show 0 Bytes But Take Space on Disk on Windows 11

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.

Symptom: Files with 0 bytes shown but disk space used; or files with large size but no disk space.
Affects: Windows 11 (and Windows 10) with NTFS.
Fix time: ~5 minutes to identify.

ADVERTISEMENT

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.

  1. Right-click the file → Properties.
  2. Compare:
    • Size: logical file size (what apps see when reading).
    • Size on disk: physical disk usage.
  3. Check Attributes:
    • Tick A (Advanced) and look for Compressed, Sparse, or Encrypted.
    • OneDrive placeholders show with cloud icon overlay in Explorer.
  4. For OneDrive files: check cloud icon. Hover over file. Tooltip indicates Available on this device / Online-only.
  5. From Terminal:
    fsutil sparse queryflag filename

    Returns 1 if sparse, 0 if not.

  6. For hard links: Terminal → fsutil hardlink list filename. Lists all paths sharing this file content.

This tells you what category the file is in.

ADVERTISEMENT

Method 2: For OneDrive placeholders, force local download

For files appearing online-only.

  1. Right-click the file (or folder) → look for OneDrive section in context menu.
  2. Click Always keep on this device. OneDrive downloads full content.
  3. Status icon changes from cloud (online-only) to green check (locally synced, always available).
  4. Size on disk now matches Size (or slightly larger due to clusters rounding).
  5. For bulk: select multiple files, right-click → Always keep on this device. Or set entire folder.
  6. To revert later: right-click → Free up space. File returns to cloud-only state.
  7. 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.

  1. Sparse files are intentional: apps create them to preallocate logical size without using physical space.
  2. Examples: VHDX/VHD virtual disks (Hyper-V), database logs, Visual Studio symbol files, some game save files.
  3. The file’s “size” reflects the maximum it could grow to; “size on disk” reflects what’s actually used.
  4. You can’t safely “defragment” or “optimize” sparse files. They’re managed by the app that created them.
  5. For Hyper-V VHDX with sparse: Optimize-VHD -Path file.vhdx -Mode Full reclaims unused space inside the VHD.
  6. For checking how much actual data is in a sparse file:
    fsutil file queryextents filename

    Lists allocated regions.

  7. 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.

ADVERTISEMENT