How to Compress an Excel File (and Why XLSX Files Get So Large)
How to Compress an Excel File
Numbers are cheap. A worksheet with 100,000 rows of genuine data is a few megabytes, because .xlsx is XML under ZIP compression and numeric data compresses extraordinarily well.
So when a workbook is 80 MB and contains a few thousand rows, the data is not responsible. Something else is inflating it, and the fastest way to compress an Excel file is to identify what before changing any settings — because the fixes are not interchangeable. Compressing images achieves nothing if your problem is a phantom used range.
Look Inside the File First
Like .docx and .pptx, an .xlsx file is a ZIP archive. You can open it and see exactly where the weight is.
- Duplicate the workbook. Work on the copy.
- Rename it from
budget.xlsxtobudget.zip. - Expand it.
- Look at
xl/worksheets/andxl/media/.
What you find tells you which section below to read:
| What is large | Cause | Fix |
|---|---|---|
One sheetN.xml at 40 MB+ | Phantom used range or column-wide formatting | Causes 1 and 2 |
xl/media/ full of photos | Images at full resolution | Cause 4 |
pivotCache files are enormous | Pivot tables storing duplicate data | Cause 3 |
styles.xml unusually large | Accumulated junk styles | Cause 5 |
That five-minute check saves you from applying four fixes when one was needed.
Cause 1: The Phantom Used Range
This is the single most common reason an Excel file is large, and the most disproportionate — it routinely turns a 400 KB workbook into 60 MB.
Excel tracks a used range per sheet: the rectangle from A1 to the furthest cell it believes contains something. Select column D and apply a border, and Excel now considers all 1,048,576 rows of that column to be in use. It writes a cell record for every one of them.
Diagnosing it
Open a sheet and press Ctrl+Shift+End. The cursor jumps to the last cell of the used range.
If your data ends at row 3,000 and the cursor lands on row 900,000 — or in column XFD — you have found your file size.
Fixing it
- Click the row number immediately below your last row of real data.
- Press Ctrl+Shift+↓ to select every row to the bottom.
- Right-click → Delete (delete rows, not just clear contents).
- Repeat horizontally: click the column right of your data, Ctrl+Shift+→, delete columns.
- Save, close, and reopen the file. The used range is only recalculated on save.
That last step matters. Skip it and Ctrl+Shift+End still reports the old range, and the file appears unchanged.
Repeat per sheet. On a workbook with fifteen sheets built by different people, several usually have this problem.
Cause 2: Conditional Formatting Applied to Whole Columns
The close cousin of the phantom range, and it is worse because conditional formatting rules are stored per applied range and re-evaluated constantly. A workbook with column-wide rules is both large and painfully slow.
Home → Conditional Formatting → Manage Rules → Show formatting rules for: This Worksheet.
Look at the Applies to column. Anything reading $A:$A or $A$1:$A$1048576 should be narrowed to the actual data range, $A$2:$A$3000.
You will also frequently find the same rule duplicated dozens of times over adjacent ranges — the residue of copying and pasting formatted rows. Delete the duplicates and apply one rule across the whole range.
Cause 3: Pivot Table Caches
Every pivot table stores a cache: a complete second copy of its source data, embedded in the file. A pivot over 200,000 rows carries those 200,000 rows twice.
If the source data lives in the same workbook, you are storing it twice for no benefit.
- Right-click the pivot table → PivotTable Options.
- Data tab.
- Untick Save source data with file.
- Tick Refresh data when opening the file.
The pivot rebuilds from the source on open. Do this for every pivot whose source is in the same workbook. On finance and reporting workbooks this is often the largest single saving available.
Cause 4: Images at Full Camera Resolution
Excel stores what you give it. A logo dropped in from a 24-megapixel photo stays 24 megapixels no matter how small the displayed image is.
- Click any image.
- Picture Format tab → Compress Pictures.
- Uncheck "Apply only to this picture".
- Tick Delete cropped areas of pictures.
- Choose a resolution by destination:
| Destination | Resolution |
|---|---|
| On-screen only | 96–150 ppi |
| Printed reports | 220 ppi |
| Never | "High fidelity" |
Excel's compression is a blunt instrument — it applies one setting to photographs and screenshots alike, and screenshots degrade badly under it. If the workbook's images matter, compress them properly first and insert the optimised versions.
Cause 5: Accumulated Junk
Long-lived workbooks collect debris that nobody ever removes.
Unused styles. Every copy-paste between workbooks imports style definitions. Files that have circulated for years accumulate tens of thousands. A large styles.xml in the unpacked archive is the tell.
Defined names. Formulas → Name Manager. Delete anything showing #REF! — those are broken references to deleted sheets, and they persist indefinitely.
Hidden sheets. Right-click any tab → Unhide. Old workbooks routinely hide a 200,000-row raw data sheet nobody has needed since 2019.
Unused formatting on empty rows. Covered by the used-range fix above, but worth re-checking after deleting sheets.
Cause 6: Volatile Formulas and Full-Column References
=VLOOKUP(A2, Sheet2!A:Z, 5, FALSE) scans a million rows. Multiply by 10,000 formulas and you have a workbook that is both bloated with calculation chains and slow enough to be unusable.
Replace full-column references (A:Z) with bounded ranges ($A$2:$Z$5000) or structured table references. The file-size gain is modest; the performance gain is not.
Where a lookup result never needs to change again — last quarter's closed figures — copy and Paste Special → Values. Formula records vanish, and the numbers remain.
Should You Save as XLSB?
The Excel Binary Workbook format stores the workbook as binary rather than compressed XML. It is typically 30–70% smaller and opens noticeably faster on large files.
File → Save As → Excel Binary Workbook (*.xlsb).
Worth knowing before you commit:
- Many external tools, Python and R libraries, and BI connectors read
.xlsxbut not.xlsb. - It can contain macros, so some corporate security policies treat it with suspicion.
- It is not a substitute for the fixes above. Saving a workbook with a phantom used range as
.xlsbgives you a smaller file that is still structurally broken and still slow.
Fix the causes first. Then decide whether .xlsb is worth the compatibility cost.
About Online Excel Compressors
Plenty of web tools will compress an XLSX. They unpack the archive, re-encode the embedded media, strip some metadata, and repack it — a subset of the operations above, run on someone else's server.
They cannot fix a phantom used range, a pivot cache, or column-wide conditional formatting, which is where the size usually is.
And there is the question of what Excel files contain. Payroll, customer lists, financial models, pricing, unreleased results. Uploading those to a free service means handing them to a third party under a retention policy you have not read. For anything confidential — which describes most serious spreadsheets — do the work locally.
A Practical Order of Operations
- Duplicate the file.
- Unpack the ZIP to find out what is actually large.
- Reset the used range on every sheet, then save, close and reopen.
- Narrow conditional formatting to real data ranges.
- Clear pivot caches where the source is in the same workbook.
- Compress or replace images.
- Delete junk — broken names, hidden sheets, unused styles.
- Save as .xlsb if compatibility allows.
Steps 3 and 5 do the overwhelming majority of the work on most real workbooks.
Fix the Container, Then the Contents
The pattern is the same one that governs Word documents and PowerPoint decks: Office files are ZIP containers, and what makes them large is almost never the thing you were actually working on.
For spreadsheets specifically, the bloat is usually structural — ranges, caches, formatting — and free to remove. What is left after that is embedded media, and media responds to real compression.
Compresto compresses the images, video and PDFs that go into and come out of your workbooks, natively on macOS — batch processing for a folder of charts and figures, format-appropriate handling for screenshots versus photographs, and no uploads, which matters when the spreadsheet is confidential.