Skip to content

Unity keeps an editor per version and a Library per project

Editors, the asset cache and per project Library folders. What is derived and what is the project.

5 min read

Unity re-encodes every asset you import into a form the target platform can use, and caches that per project. The rule that follows is the useful one: the folder you should not back up is usually the folder that is largest.

What is in a project

FolderWhat it isSafe to delete
AssetsYour workNo
ProjectSettingsProject configurationNo
PackagesPackage manifestNo
LibraryImported asset cache, per platformYes, reimported on open
Temp, objBuild scratchYes
BuildsOutput you exportedOnly if kept elsewhere
Get-ChildItem $env:USERPROFILE -Recurse -Directory -Filter Library -Depth 4 -EA SilentlyContinue |
  Where-Object { Test-Path (Join-Path $_.FullName '..\Assets') } |
  ForEach-Object {
    $s = (Get-ChildItem $_.FullName -Recurse -Force -File -EA SilentlyContinue | Measure-Object Length -Sum).Sum
    [PSCustomObject]@{ GB = [math]::Round($s/1GB,2); Path = $_.FullName }
  } | Sort-Object GB -Descending | Select-Object -First 15

The check for an Assets folder alongside is what stops that matching every other folder called Library on a Windows machine, of which there are many.

Editors accumulate

Get-ChildItem 'C:\Program Files\Unity\Hub\Editor' -Directory -EA SilentlyContinue | ForEach-Object {
  $s = (Get-ChildItem $_.FullName -Recurse -Force -File -EA SilentlyContinue | Measure-Object Length -Sum).Sum
  [PSCustomObject]@{ GB = [math]::Round($s/1GB,2); Version = $_.Name }
} | Sort-Object GB -Descending

Each editor is several gigabytes plus a module per build target you added. Projects pin a version, so old editors accumulate. Remove them through Unity Hub rather than deleting folders, and check each project's ProjectSettings\ProjectVersion.txt first.

The shared caches

The Asset Store download cache and the global package cache live under %APPDATA%\Unity and %LOCALAPPDATA%\Unity, and hold every package you have ever downloaded. Both are redownloadable and neither is cleared by anything.

Platform switching doubles the cache

Switching build target reimports assets for the new platform and the cache keeps both, which is usually why a Library folder is several times the size of the assets. The same shape on the other platform is in Unity projects on a Mac.

Common questions

Can I delete Unity's Library folder?

Yes. It is an import cache derived entirely from Assets and ProjectSettings, and Unity rebuilds it when the project is next opened. The cost is reimport time.

Where does Unity install editors on Windows?

Under C:\Program Files\Unity\Hub\Editor, one folder per version, each several gigabytes plus modules per build target.

Why is my Unity project folder so large?

Because the Library folder holds re-encoded copies of every imported asset, per build platform. A project built for several platforms keeps the cache for each.

How do I remove old Unity versions?

Through Unity Hub, so its list stays accurate. Check each project's ProjectSettings\ProjectVersion.txt first to see which versions are still pinned.

Read next