How to Resize a Window to an Exact Size on Mac (Width and Height)
macOS has no box for typing a window's width and height. Set an exact size with a one-line AppleScript or Shortcuts, then save it so it comes back.
macOS has no field where you can type a window's width and height. To get an exact size, run a short AppleScript through System Events (for example set size of window 1 to {1280, 720}), or use the Resize Window action in the Shortcuts app. Sizes are measured in points, not pixels, so on a Retina display a 1280×720 window is really 2560×1440 pixels. To get the same size back later without re-running anything, save it as a layout.
Can you type an exact window size in macOS?
Not natively. Finder, System Settings and the green button give you no numeric entry. What you do get:
- Drag an edge or corner. Hold Option while dragging to resize from the centre, so the window grows evenly on both sides.
- Double-click an edge. Double-clicking the bottom edge stretches the window to the full height of the screen. The left or right edge does the same for width.
- Fill the screen. On macOS 15 and later, Fn+Control+F fills the screen. I covered that and the other options in the maximize shortcut guide.
- Half and quarter tiling. macOS 15 also tiles to halves and quarters, but none of these are precise numbers.
If you need 1280×720 for a screen recording, 1440 wide for a screenshot, or a fixed size to test a layout, you need a script or an app.
How do I set a window to an exact size with AppleScript?
The built-in osascript command can drive any app's window through System Events. For a one-off, paste this into Terminal (Applications → Utilities → Terminal), swapping in your app's name:
bash osascript -e 'tell application "System Events" to tell process "Safari" to set size of window 1 to {1280, 720}'
To set position and size together, open Script Editor (also in Utilities) and run:
applescript tell application "System Events" tell process "Safari" set position of window 1 to {100, 80} set size of window 1 to {1280, 720} end tell end tell
The numbers are width and height (or x and y for position), measured from the top-left of your main display. The process name is usually the app's name; for Chrome it is "Google Chrome".
The first run will fail or do nothing until you allow it: open System Settings → Privacy & Security → Accessibility and switch on Terminal or Script Editor. On macOS 27 that pane is called Device Control and Data Access.
Why is my 1280×720 window 2560×1440 pixels?
AppleScript works in points, the unit macOS uses for layout. On a Retina display at the default scaling, one point is two pixels across and two down. A window you set to 1280×720 points therefore captures as 2560×1440 pixels.
If you need an exact pixel size for a recording or screenshot, set the size in points and then check the saved file. If the display is scaled to something other than the default, the ratio changes, so check once before you rely on it.
To read a window's current size, replace the set line with get size of window 1.
Can I do it without code, using Shortcuts?
Recent macOS versions include window actions in the Shortcuts app (Applications → Shortcuts). Search the action list for Resize Window and Move Window, add them to a new shortcut, type the width and height, and pick the app. You can then give the shortcut a keyboard shortcut or add it to the menu bar.
It does the same job as the script, with a friendlier editor. The catch is the same too: you build one shortcut per size and per app.
Why won't some windows resize to the size I set?
A few usual suspects:
- Fixed-size windows. Calculator and parts of System Settings have limits on how wide or tall they can go. macOS clamps the result to the nearest allowed size.
- Minimum sizes. Many apps refuse to shrink below a width where their toolbar still fits.
- Screen limits. A window can't be taller than the usable area under the menu bar, and macOS nudges it back if you ask for more.
- Missing permission. If nothing happens at all, the Accessibility switch is the first thing to check.
- Apps that fight back. Electron and some GPU-rendered apps can snap back to a previous size a moment later. Running the command again after the app has finished launching usually fixes it.
How do I get the same size back every time?
Scripts get you a size, but you have to re-run them, and you need one per app. If you want a whole arrangement back with one key, save it as a layout instead.
Layoutish stores every window's position and size across all your displays. The routine is: set your windows to the size you want (drag, or run the script once), save a layout from the menu bar, and give it a hotkey. Apply it later with the hotkey or the Quick Switcher (⌘⇧L), and missing apps are launched for you. You can update the layout in place, keeping its name, icon and hotkey, if you tweak a size later. A layout hotkey needs ⌘ or ⌃ in it, because macOS 15 refuses ⌥-only shortcuts.
One honest limit: Layoutish remembers the sizes you've set, but it has no box for typing 1280 and 720. For that, use the script above to get the size and Layoutish to keep it. Moom ($10) lets you define custom sizes by hand if that's your main need. Layoutish is $9.99 once after a 7-day free trial, no card.
If you move between monitors a lot, saving window positions across displays covers display profiles and scheduling too.
Common questions
How do I check a window's size on Mac?
There is no built-in readout. Run get size of window 1 inside a System Events tell process block in Script Editor, and it returns width and height in points. For pixel dimensions of a screenshot, check the saved file's size in Preview (Tools → Show Inspector).
Can I resize a window with the keyboard on Mac?
Not to a typed size. On macOS 15 and later, Fn+Control+F fills the screen and Fn+Control with an arrow key tiles to a half. For anything more specific you need a script, a Shortcuts action or a window manager.
Is there a free way to set a window to an exact size?
Yes: AppleScript and Shortcuts are both built into macOS and cost nothing. They only need the Accessibility permission, and they work with most apps whose windows can be resized. If you want to snap windows to halves and thirds for free, Rectangle is a solid option, though it is a snapping tool rather than a place to type exact numbers.