Menu bar icon spacing on Mac: fit more icons beside the notch
Change menu bar icon spacing on a Mac with two Terminal commands, so more icons fit beside the notch. What each setting does, and how to apply and undo it.
To change the spacing between menu bar icons on a Mac, set two hidden preferences in Terminal, NSStatusItemSpacing and NSStatusItemSelectionPadding, to a smaller number, then log out and back in. The icons sit closer together, so more of them fit beside the notch, and deleting the two settings puts everything back.
There is no switch for this in System Settings, and Apple doesn't document these preferences, so treat it as an unofficial tweak. It has worked on recent versions of macOS, but a future update could ignore it. It only changes your own preferences and is easy to reverse. Below: what the two settings do, the exact commands, which numbers to try, how to undo it and what to check if nothing changes.
What the two settings do
The right side of the menu bar is a row of status items: Wi-Fi, sound, battery, other apps' icons. Two preferences control how much room each one takes.
| Setting | What it controls | A smaller number means |
|---|---|---|
NSStatusItemSpacing | The gap between one status item and the next | Icons sit closer together |
NSStatusItemSelectionPadding | The padding inside the highlight that appears behind an item when you click it | Each item takes up a little less room |
Neither setting changes the size of the icons themselves, the app menus on the left of the bar, or the text of the clock. They only squeeze the empty space around status items.
Both are written with -currentHost, which stores them for this Mac only, in a preferences file inside the ByHost folder of your user Library (~/Library/Preferences/ByHost). They don't sync to your other Macs, and they don't affect other user accounts on this one.
Is it safe to change menu bar spacing?
Yes, for most people. These are ordinary user preferences, the same kind of setting System Settings saves when you flip a switch. Changing them needs no administrator password and doesn't touch system files, and it isn't the kind of change that stops a Mac from starting up. The likely worst case is a menu bar that looks a little cramped until you delete the two settings again.
Check what you have now
Before changing anything, see whether either setting is already set. Open Terminal (in Applications > Utilities, or press Command-Space and type Terminal), then run:
defaults -currentHost read -globalDomain NSStatusItemSpacing
defaults -currentHost read -globalDomain NSStatusItemSelectionPadding
These only read; they change nothing. If each prints a message ending in "does not exist", you are on macOS's own spacing. If one prints a number, someone, possibly you a while ago, has already changed it.
How to change menu bar icon spacing on a Mac
- Open Terminal.
- Set the gap between icons. Type or paste this line and press Return:
defaults -currentHost write -globalDomain NSStatusItemSpacing -int 6 - Set the highlight padding the same way:
defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 6 - Save your work, then choose Apple menu > Log Out and log back in. A restart also works. Until you do, nothing on screen changes.
- Look at the menu bar. If icons that used to vanish beside the notch are back, you're done.
A successful defaults write prints nothing at all, which can feel like it failed. It didn't.
Two small traps are worth avoiding. The defaults command accepts any key name you give it, so a typo such as NSStatusItemSpaceing is stored without complaint and does nothing. Copy the names exactly. And if you paste from a document, make sure every hyphen arrived as a plain hyphen; a long dash in its place will break the command.
What numbers should you use?
Smaller numbers pack the icons closer; larger ones spread them out. There is no official range, so a little experimenting helps.
- Start with 6 for both. It is a common starting point and packs icons noticeably closer on most setups.
- If clicking feels fiddly, go up to 8 or 10. Very low values leave so little space that it becomes easy to click the neighbor of the icon you meant.
- Change one setting at a time after the first try, so you can see what each does on your own menu bar. If you're not sure where to go, keep the two numbers equal.
Each change needs another log out to show up, so pick a value, live with it for a day, and adjust once rather than many times in a row.
How do you undo the spacing change?
Delete both settings and log out again. macOS goes back to its own spacing.
defaults -currentHost delete -globalDomain NSStatusItemSpacing
defaults -currentHost delete -globalDomain NSStatusItemSelectionPadding
Keep the -currentHost part. Without it, defaults looks in a different preferences file, prints an error, and the setting you made stays exactly where it was. Some guides online leave -currentHost out when they write the setting; if you followed one of those, run the same two delete lines without -currentHost as well. Deleting a key that isn't there only prints an error and does no harm.
If it doesn't seem to work
- You haven't logged out yet. This is the usual reason. Log out and back in, or restart, rather than waiting for the bar to catch up.
- The
-currentHostparts don't match. A setting written with it and read or deleted without it (or the other way round) looks as if it isn't there. - The wide item is the problem, not the gaps. Some apps put text, a timer or a graph in the menu bar. Spacing only shrinks the gaps around them, not their width. Check that app's settings for a compact or icon-only option.
- The menu bar size is set to Large. System Settings > Accessibility > Display has a "Menu bar size" option. Large makes the menu bar text bigger and fits fewer icons, which can cancel out what you gained.
- An update ignored it. Because the preferences are undocumented, any macOS update could stop honoring them. If the spacing goes back to normal after an update and the commands no longer help, delete the settings so nothing stale is left behind.
If you still have more icons than room, tighter spacing won't fix that alone. How to organize Mac menu bar icons covers trimming what you show, and menu bar icons hidden behind the notch explains why icons vanish on a notched MacBook in the first place.
Where Notchpals fits
Notchpals asks for a single spot in the menu bar, for a pair of eyes: that is where you pause its characters or start a focus session. Everything else it does happens in the notch itself, the stretch of the top edge that status icons are never allowed into. Tighter spacing makes the eyes easier to keep in view, and placing them near the clock keeps them out of the group that gets dropped first.
One character suits this topic. Otto, an octopus with every arm busy, is a Tech care character who looks after the Mac itself. If your Mac goes a week without a restart, Otto comes by once, in the daytime, to suggest one:
OttoA week of juggling! Even computers need to drop it all sometimes.
A restart is also the easiest way to apply a spacing change you made and never logged out for, so that visit can do two jobs at once.
More on the notch
The notchHow to organize Mac menu bar icons: move, hide and trimHow to organize Mac menu bar icons: Command-drag to reorder or remove them, pick Apple's items in Control Center settings, and keep the bar short.
The notchA notch for Macs without one: how Notchpals works on any MacNo notch on your iMac, Mac mini or external display? Notchpals draws a black island at the top of the main display. How it works, and which screen it picks.
The notchCan you hide the notch on a MacBook? Ways to make it disappearYou can't switch the notch off, but you can make it fade: a black band in your wallpaper, full screen apps, one Finder setting, and a little time.
