Quick answer
iCloud Drive and OneDrive can keep a file online-only: it stays in Finder or File Explorer, but its content lives only in the cloud. To free space, turn on Optimize Mac Storage for iCloud Drive, or right-click a OneDrive file and choose Free up space. Never delete a synced file to save space; that deletes it on every device.
On this page
Where synced files are kept
Both services keep a synced folder on your disk. Each file in it is either downloaded, and uses space, or online-only, and uses almost none. Cloud folders are one part of what fills a Mac and what is safe to delete.
- iCloud Drive on a Mac:
~/Library/Mobile Documents. Finder shows it as iCloud Drive in the sidebar. - Desktop and Documents with iCloud:
~/Desktopand~/Documentssync to iCloud Drive when Desktop & Documents Folders is on. - iCloud Photos on a Mac: the Photos library, by default
~/Pictures/Photos Library.photoslibrary. - OneDrive on a Mac:
~/Library/CloudStorage/OneDrive-Personal, or a folder named after your organization for a work or school account. - OneDrive on Windows:
%USERPROFILE%\OneDrive, or a folder named "OneDrive - " and your organization's name for a work or school account.
On a PC, read what fills a Windows C: drive for the other large folders.
What "online-only" means
An online-only file is a placeholder. Its name, icon and details stay in the folder, but the content stays in the cloud. Microsoft's developer documentation says a placeholder uses only 1 KB of storage for the file system header. When you open the file, it downloads.
You need an internet connection to open an online-only file. Apps see it as a normal file, so opening it in any app starts the download.
The three OneDrive states
- Online-only (cloud icon): uses no space for its content. It downloads when you open it.
- Locally available (green check mark in a circle outline): downloaded because you opened it. You can make it online-only again.
- Always available (solid green circle with a white check mark): you chose Always keep on this device. It stays downloaded, even offline.
Microsoft's documentation says Windows can make a locally available file online-only again when space is needed. A file you pinned with Always keep on this device is guaranteed to stay offline.
iCloud Drive in Finder
Finder shows a cloud icon with a down arrow next to items that are only in iCloud. Apple's guide to iCloud Drive status icons lists the other states, such as uploading and downloading.
What is safe to delete
| Path | What it is | Safe to delete | What happens if you delete it | How to clean it |
|---|---|---|---|---|
~/ | iCloud Drive's folder on this Mac | No | Files are deleted from iCloud and every device | Remove Download in Finder, or Optimize Mac Storage |
~/ and ~/ | Your files, synced when Desktop & Documents Folders is on | Careful | A deleted file is gone from iCloud and every device | Remove Download; delete only what you want gone everywhere |
~/ | Photos library, with iCloud Photos | No | You can lose photos; deletions in Photos sync to all devices | Photos > Settings > iCloud > Optimize Mac Storage |
~/ | OneDrive folder on a Mac | No | Files are deleted from OneDrive and every device | Free Up Space in Finder |
%USERPROFILE%\ | OneDrive folder on Windows | No | Files are deleted from OneDrive and every device | Free up space in File Explorer, or Storage Sense |
| Online-only files | Placeholders of cloud files | Careful | The file is deleted everywhere, and the deletion frees almost no space | Leave them; they use almost no space |
How to free space by hand
Use the built-in settings. They change where the content is kept and never delete the file itself.
iCloud Drive: Optimize Mac Storage
- Choose Apple menu > System Settings, then click your name.
- Click iCloud and turn on Optimize Mac Storage.
- Apple says the whole of iCloud Drive stays on the Mac while there is enough space. When space is needed, older documents are kept only in iCloud.
To free space right now, open iCloud Drive in Finder. Control-click a file or folder and choose Remove Download. To get it back, choose Download Now, or open the file.
iCloud Photos: Optimize Mac Storage
- Open Photos and choose Photos > Settings, then click iCloud.
- Select Optimize Mac Storage.
The full-resolution originals stay in iCloud, and the Mac keeps smaller versions. Photos downloads an original when you need it. Download Originals to this Mac keeps every original on the disk.
Desktop & Documents Folders
When this setting is on, your Desktop and Documents files are in iCloud Drive and Optimize Mac Storage can make them online-only. Turn it on or off in the iCloud Drive settings under System Settings > your name > iCloud.
If you turn it off, the files stay in iCloud Drive, and your Mac gets new Desktop and Documents folders. Move back the files you want on the Mac. Apple's article Turn off Desktop & Documents Folders on your Mac has the steps.
OneDrive on Windows: Free up space
- Open File Explorer and select your OneDrive folder.
- Right-click a file or folder and select Free up space. It becomes online-only.
- To keep a file offline, right-click it and select Always keep on this device.
To change a whole folder from Command Prompt, go to the folder and run the next command. It marks every file in the folder and its subfolders online-only; it deletes nothing.
attrib +U -P /sTo keep every file in that folder on the device instead, run attrib -U +P /s.
Storage Sense: make unused OneDrive files online-only
- Select Start > Settings > System > Storage.
- Select Storage Sense.
- Under Locally available cloud content, choose how long a OneDrive file can stay unopened before it becomes online-only.
Files you marked Always keep on this device are not changed. Storage Sense works on the system drive (C:).
OneDrive on a Mac: Free Up Space
In Finder, open the OneDrive folder. Control-click a file or folder and choose Free Up Space. To keep it downloaded, choose Always Keep on This Device.
OneDrive folder backup
OneDrive can back up your Desktop, Documents and Pictures folders. Their files then live in OneDrive, sync to the cloud, and can be made online-only like any other OneDrive file. Microsoft's guide to OneDrive folder backup explains what happens to the files when you stop the backup.
Why deleting a synced file is not the same
A synced folder is a mirror. When you delete a file in it, the service deletes the file in the cloud and on every other device. Microsoft says this applies to online-only files too.
- OneDrive: deleted files go to the OneDrive recycle bin. Microsoft says it keeps them for 30 days for personal accounts and up to 93 days for work or school accounts.
- iCloud Drive: you can recover files deleted in the last 30 days from Recently Deleted on iCloud.com.
To keep a file only on this computer, move it out of the synced folder first. It then leaves the cloud and stays on your disk.
How KemptDesk handles this
KemptDesk counts online-only iCloud and OneDrive files as 0 bytes, because they use no space for their content. It does not open them, so a scan does not download them. On a Mac, Hidden space marks ~/Library/Mobile Documents and ~/Library/CloudStorage Protected and tells you to manage them in Finder. On a PC, the OneDrive folder is Check first, with a hint to use Free up space in the OneDrive menu. KemptDesk never removes the OneDrive, Desktop or Documents folder as a whole, and never removes iCloud caches in ~/Library/Caches. KemptDesk does not make files online-only and does not change iCloud or OneDrive settings.
Questions
Does "Free up space" in OneDrive delete my files?
No. The file becomes online-only. It stays in OneDrive and in your folder, and it downloads again when you open it.
Why is my Mac still full with Optimize Mac Storage on?
macOS keeps iCloud Drive files on the Mac while there is enough space. It moves older documents to iCloud only when space is needed. Use Remove Download in Finder to free space now.
If I delete a file in my OneDrive folder, is it deleted online too?
Yes. It is deleted from OneDrive on all devices. You can restore it from the OneDrive recycle bin for a limited time.
Can I delete the iCloud Drive folder on my Mac to save space?
No. Deleting files in it deletes them from iCloud and your other devices. Turn on Optimize Mac Storage or use Remove Download instead.
Do online-only files take up space?
Almost none. A placeholder keeps only the file's name and details on the disk until you open it.
Sources
- Optimize storage space on your Mac (Mac User Guide)
- Work with folders and files in iCloud Drive (Mac User Guide)
- Check your iCloud Drive file and folder status on Mac (Mac User Guide)
- Add your Desktop and Documents files to iCloud Drive (Apple Support)
- Turn off Desktop & Documents Folders on your Mac (Apple Support)
- Use iCloud Photos on Mac (Photos User Guide)
- If you're missing files in iCloud Drive (Apple Support)
- Save disk space with OneDrive Files On-Demand for Windows (Microsoft Support)
- Save disk space with OneDrive Files On-Demand for Mac (Microsoft Support)
- Fix OneDrive Files On-Demand issues on macOS 12.1 or later (Microsoft Support)
- Use OneDrive and Storage Sense to manage disk space (Microsoft Support)
- What happens when you delete files in the cloud (Microsoft Support)
- Restore deleted files or folders in OneDrive (Microsoft Support)
- Back up your folders with OneDrive (Microsoft Support)
- Query and set Files On-Demand states in Windows (Microsoft Learn)
- Build a cloud sync engine that supports placeholder files (Microsoft Learn)
- File attribute constants (Microsoft Learn)
- attrib command (Microsoft Learn)
- Manage drive space with Storage Sense (Microsoft Support)