How to Set an Exact Dock Size on Mac With Terminal
The Dock size slider in System Settings is an analog dial: you nudge it, eyeball the result, nudge again, and never quite reproduce last month's setting. Under the hood, though, Dock size is just a number — the tilesize preference, in points — and Terminal lets you set it exactly. Same number, same Dock, every Mac, every time. Works on Ventura, Sonoma, and Sequoia.
Set the size
Open Terminal (Applications → Utilities) and run:
# set Dock icons to exactly 48 points
defaults write com.apple.dock tilesize -int 48
killall Dock
The Dock restarts in about a second at the new size. The value is the edge length of each icon in points; useful ranges:
- 16–32 — genuinely tiny; a thin strip for people who launch everything from Spotlight.
- 36–48 — compact and comfortable on laptop screens; 48 is a sweet spot.
- 52–64 — roomy; suits large external displays and touch-typists who mouse casually.
- 96–128 — billboard territory; occasionally right for accessibility or demo machines.
Values map to the same range as the slider — the slider is just this key with a UI. You can watch that live: open System Settings → Desktop & Dock and the Size slider now sits exactly where your number put it.
Read it, change it, undo it
# what size is the Dock right now?
defaults read com.apple.dock tilesize
# revert to the default size
defaults delete com.apple.dock tilesize
killall Dock
If defaults read errors with “does not exist,” the Dock is at its factory size and the key simply hasn't been written yet. Deleting the key is always a safe undo — the Dock falls back to its built-in default.
Why exact beats eyeball
- Repeatability: “48” means the same thing on every Mac. Your work machine, your home machine, and next year's replacement can all match to the point.
- Scriptability: one line in a dotfiles or setup script configures the Dock along with everything else — no settings-pane safari on a new Mac.
- Precision at the small end: the slider's low range is touchy, where a millimeter of drag changes several points. Typing
-int 34ends the fiddling.
The two companion keys
Exact size pairs naturally with two other Dock preferences:
# set the magnified (hover) size too, if you use magnification
defaults write com.apple.dock largesize -int 96
# then freeze the size so a stray drag on the divider can't change it
defaults write com.apple.dock size-immutable -bool true
killall Dock
largesize controls how big icons swell under the pointer when magnification is on (16–128, same units). size-immutable locks your number in place — the divider drag and the slider both stop working until you defaults delete com.apple.dock size-immutable. Set, verify, lock: a Dock that's exactly the size you chose, indefinitely.
Points, not pixels
One unit clarification so the numbers make sense across machines: tilesize is measured in points, macOS's resolution-independent unit. On a Retina display a point is backed by multiple physical pixels, so -int 48 produces the same physical icon size on a MacBook's built-in screen as on a 5K display at default scaling — which is exactly what you want from a repeatable setting. It also means the number interacts with your display's scaling choice in System Settings → Displays: pick a “more space” scaled resolution and everything, Dock included, renders smaller. Set your display scaling first, then dial in tilesize.
Exact Dock sizing is one of Mainspring's 90+ labelled macOS toggles — pick the number, see it applied, revert in one click, no defaults syntax required.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
Building a whole scripted Dock?
Size is one key among many — position, autohide timing, hidden effects and more all live in the same domain. Customize the Mac Dock from Terminal tours the full set.