How to Get Screen Coordinates on Windows 11, macOS & For Designers / QA Testing
Finding exact screen coordinates is not a one-size-fits-all task. A Windows automation engineer needs physical pixel precision for AutoHotkey scripts. A macOS designer needs logical point values for Figma handoffs. A QA tester needs to translate between viewport-relative web coordinates and global monitor coordinates. This guide provides step-by-step workflows tailored to each platform and professional role.
Open the Screen Coordinates ToolHow to Get Screen Coordinates on Windows 11
Windows offers several built-in and third-party ways to find X/Y coordinates. The method you choose depends on whether you need a quick one-off measurement or a continuous live tracking workflow.
Method 1: Use the Built-In Screen Coordinates Tool (No Install)
The easiest way to get screen coordinates on Windows 11 is to use an online screen coordinates tool. No installation is required, and it works in any browser.
- Open the Screen Coordinates Tool in Chrome, Edge, or Firefox.
- Press
F11to enter fullscreen mode for the most accurate readings. - Move your mouse anywhere on screen. The X and Y values update in real time.
- Click to lock a coordinate, then copy the values directly into your script or notes.
Pros: No installation, works in any browser, instant live tracking.
Cons: Requires an internet connection.
Method 2: Find Mouse Coordinates with PowerShell
Windows PowerShell can read the current mouse position using .NET API calls. This is useful for scripting and automation workflows.
Add-Type -AssemblyName System.Windows.Forms
$pos = [System.Windows.Forms.Cursor]::Position
Write-Output "Mouse X: $($pos.X), Mouse Y: $($pos.Y)"
Run this script in PowerShell to instantly display your current mouse coordinates. You can also wrap it in a loop to track movement continuously.
Method 3: Get Screen Coordinates with AutoHotkey on Windows 11
AutoHotkey is a powerful Windows automation tool that can display live mouse coordinates with a simple script:
; AutoHotkey v2: Show mouse coordinates in a tooltip
#Requires AutoHotkey v2.0
#Persistent
SetTimer ShowCoords, 100
ShowCoords() {
MouseGetPos &x, &y
ToolTip "X: " x " Y: " y
}
Save this as a .ahk file and double-click to run. A tooltip will follow your cursor, showing live X/Y coordinates on screen.
Method 4: Microsoft PowerToys (Power Users)
Microsoft's official PowerToys suite includes a "Screen Ruler" and "Mouse Utilities" that can display live coordinates and measure distances between points.
- Download PowerToys from the Microsoft Store or GitHub.
- Enable the "Mouse Pointer Crosshairs" utility.
- Use the crosshair to align precisely with any pixel and read its position.
Windows 11 DPI Scaling Warning: If your Display Settings show 125% or 150% scaling, browser-based tools and OS-level automation tools may report different numbers. See our technical guide for how to handle DPI scaling correctly.
Windows Multi-Monitor Behavior
Windows treats multiple monitors as a single virtual desktop. The primary monitor holds the (0, 0) origin. Monitors placed to the left produce negative X coordinates; monitors placed above produce negative Y coordinates. You can verify your layout by opening Settings > System > Display and observing how the monitor rectangles are arranged relative to each other.
How to Get Mouse Coordinates on macOS
macOS provides elegant built-in tools for coordinate discovery, but the Retina display scaling model introduces a layer of abstraction that Windows users may find confusing at first.
Method 1: The Built-in Screenshot Crosshair (Cmd + Shift + 4)
This is the fastest native method and requires zero installation.
- Press
Command (⌘) + Shift + 4. - Your cursor becomes a precision crosshair with live X, Y numbers displayed beside it.
- Move to your target location and read the coordinates.
- Press
Escto cancel without saving a screenshot file.
Pros: Instant, native, no network required.
Cons: The numbers are small and hard to read from a distance; you cannot copy-paste the values directly into code.
Method 2: Online Tracker for Copy-Paste Workflows
If you need to copy exact coordinates into a script or record a sequence of positions, a web tool is more practical than memorizing crosshair numbers.
- Open the Screen Coordinates Tool in Safari or Chrome.
- Enter fullscreen mode with
Control + Command + F(Safari) orF11(Chrome). - Move your mouse to track and copy exact X/Y positions in real time.
macOS Retina Display Warning
Most modern Macs use Retina displays with a device pixel ratio of 2.0 (or higher on Pro Display XDR). macOS defaults to a "scaled" resolution that looks like 1440 x 900 on a 2880 x 1800 panel. The Cmd+Shift+4 crosshair shows logical point coordinates, not physical pixels.
If your automation script (e.g., Python with PyAutoGUI, AppleScript, or Hammerspoon) requires physical pixel coordinates, multiply the crosshair values by your backing scale factor:
# macOS logical-to-physical conversion
logical_x, logical_y = 720, 450 # values from Cmd+Shift+4
backing_scale = 2.0 # 2.0 for most Retina Macs
physical_x = int(logical_x * backing_scale)
physical_y = int(logical_y * backing_scale)
To determine your exact backing scale factor programmatically, use NSScreen.main?.backingScaleFactor in Swift, or run system_profiler SPDisplaysDataType | grep "Retina" in Terminal to confirm your display type.
Accessibility Inspector (Developers)
macOS developers can use Accessibility Inspector (bundled with Xcode) to inspect UI element positions in both screen and window coordinates. This is especially useful when writing AppleScript or UI automation tests for native macOS apps.
Screen Coordinates for UI/UX Designers
Designing pixel-perfect interfaces in Figma, Adobe XD, Sketch, or Photoshop requires fluency in the coordinate systems that developers use. A design handoff that ignores coordinate translation is a recipe for implementation mismatches.
Concept 1: Artboard vs Global Coordinates
Design tools use a relative coordinate system that can confuse developers if not documented properly.
- Artboard Coordinates: Inside Figma or Sketch, the top-left corner of your specific Artboard or Frame is always (0, 0). An element positioned at (120, 80) is 120px from the left edge of the Artboard and 80px from the top.
- Global Coordinates: On a physical monitor, the top-left of the entire screen is (0, 0). Our web tool measures global screen coordinates, not Artboard-relative ones.
When handing off specs, always label whether your X/Y values are relative to a parent container, the Artboard, or the global viewport. A common convention is to include a note like: "All coordinates relative to Artboard top-left unless otherwise stated."
Concept 2: Translating X/Y to CSS
Design X and Y values map directly to CSS properties when using absolute positioning:
/* Figma: Element at X=120, Y=80 within a 400x300 container */
.pixel-perfect-element {
position: absolute;
left: 120px; /* corresponds to Figma X */
top: 80px; /* corresponds to Figma Y */
width: 160px; /* Figma width */
height: 40px; /* Figma height */
}
Pro Tip: Use built-in rulers (Cmd+R or Ctrl+R in most design apps) to pull guide lines and instantly check alignment coordinates without selecting individual elements. This is faster than reading the Inspector panel for every element.
Concept 3: Spacing Verification with Coordinate Math
Instead of eyeballing whether two buttons are evenly spaced, use coordinates to verify mathematically:
/* If Button A ends at X=200 and Button B starts at X=220,
the gap is 20px. If both buttons are 80px wide and should
have 16px padding, the expected gap is 16px.
220 - 200 = 20px. This is 4px too wide. */
Export your design as a static image, load it into the Screen Coordinates Tool, and hover over edges to confirm spacing values match your design system tokens.
Design QA Workflow
For design QA — verifying that the implemented web page matches the original design — use this workflow:
- Open the staging website and your Figma file side by side.
- Take a screenshot of the web page at exactly the design's target viewport width.
- Overlay the screenshot on top of the Figma frame in a design tool, or use a browser extension like PerfectPixel.
- Use the coordinate tool to measure misalignment at specific elements. Even a 1-2 pixel drift is visible when you know the expected position.
Screen Coordinates for QA Testing & Automation
Automated UI testing frameworks like Selenium, Playwright, and Cypress prefer DOM-based selectors (IDs, data-testids, ARIA labels). But there are legitimate scenarios where screen coordinates are necessary: canvas-based games, WebGL visualizations, complex drawing apps, legacy desktop wrappers, and OS-level macro testing.
Method 1: Browser DevTools (Web QA)
For standard web testing, you can extract element coordinates using built-in browser tools without external libraries.
- Right-click the target element and select Inspect.
- In the Elements panel, the computed box model shows width, height, padding, and margin.
- For precise viewport-relative coordinates, open the Console and run:
// Get the bounding rectangle relative to the viewport const rect = document.querySelector('[data-testid="submit"]').getBoundingClientRect(); console.log(rect.x, rect.y, rect.width, rect.height); // Convert viewport coordinates to document coordinates const docX = rect.x + window.scrollX; const docY = rect.y + window.scrollY;
Important: getBoundingClientRect() returns viewport-relative coordinates (like clientX), not global monitor coordinates. Selenium's ActionChains.move_by_offset and Playwright's mouse.click(x, y) also operate in viewport space.
Method 2: Desktop Automation with Global Coordinates
When testing non-web applications or using tools like PyAutoGUI and AutoHotkey, you need absolute global monitor coordinates.
- Open the Screen Coordinates Tool in fullscreen mode.
- Move your mouse over the application area you are testing.
- Record the X and Y values.
- Input them into your automation script:
import pyautogui # Ensure DPI awareness on Windows first # (see the technical guide for details) pyautogui.click(x=840, y=620) pyautogui.sleep(0.5) pyautogui.typewrite("Test input", interval=0.01)
Method 3: Screenshot-Based Regression Testing
For visual regression testing, coordinates are used to define "ignore regions" (areas that change intentionally, like timestamps) or "diff hotspots" (areas that must remain pixel-identical).
// Playwright example: pixel-perfect visual comparison
// with an ignore region for the clock area
await expect(page).toHaveScreenshot('dashboard.png', {
clip: { x: 0, y: 0, width: 1280, height: 720 },
// Some tools allow masking specific coordinate ranges
});
Viewport vs Screen: A Decision Framework
| Coordinate Type | Origin | Used By | When You Need It |
|---|---|---|---|
| Viewport (clientX/clientY) | Top-left of browser window | Selenium, Playwright, Cypress | Web element interaction, responsive testing |
| Document (pageX/pageY) | Top-left of full HTML document | JavaScript event handlers | Scrolling-aware elements, infinite scroll |
| Screen (screenX/screenY) | Top-left of primary monitor | PyAutoGUI, AutoHotkey, AppleScript | OS-level macros, cross-application workflows |
QA Best Practices
- Prefer DOM selectors over coordinates. Only use coordinates when the target has no stable selector (canvas, WebGL, video overlays).
- Record coordinates at the target viewport size. Responsive layouts shift element positions at different breakpoints.
- Account for OS scaling. A test that passes on a 100% scaling developer machine may fail on a 125% scaling CI runner. See our technical guide for platform-specific fixes.
- Document coordinate assumptions. Include a README in your test suite that states the expected screen resolution, browser zoom level, and OS scaling for coordinate-based tests.
Get Screen Coordinates with Python (PyAutoGUI)
Python's PyAutoGUI library is the most popular cross-platform tool for automating mouse movements and reading screen coordinates. It works on Windows 11, macOS, and Linux with the same API.
Basic PyAutoGUI Coordinate Reading
import pyautogui
# Get current mouse position
x, y = pyautogui.position()
print(f"Current mouse position: ({x}, {y})")
# Get screen size
width, height = pyautogui.size()
print(f"Screen size: {width}x{height}")
Handling DPI Scaling on Windows 11
On Windows 11 with display scaling enabled, PyAutoGUI may return logical coordinates instead of physical pixels. To get accurate screen coordinates, declare DPI awareness before importing PyAutoGUI:
import ctypes
import pyautogui
# Declare DPI awareness BEFORE using pyautogui
ctypes.windll.user32.SetProcessDPIAware()
# Now pyautogui.size() returns PHYSICAL pixels
width, height = pyautogui.size()
print(f"Physical screen size: {width}x{height}")
# Move mouse and click
pyautogui.moveTo(960, 540, duration=1)
pyautogui.click()
Real-Time Mouse Tracking with Python
You can build a simple mouse coordinate tracker that prints position in real time:
import pyautogui
import time
try:
while True:
x, y = pyautogui.position()
print(f"\rMouse: ({x}, {y})", end="", flush=True)
time.sleep(0.1)
except KeyboardInterrupt:
print("\nTracking stopped.")
Press Ctrl+C to stop the script. This is useful for debugging automation scripts or recording coordinate sequences.
Tip: On macOS, PyAutoGUI generally handles Retina displays correctly because macOS's Quartz API reports physical sizes. However, if you read coordinates from the Cmd+Shift+4 crosshair, remember to multiply by the backing scale factor (usually 2.0).
Platform Comparison Cheat Sheet
| Task | Windows | macOS | Web Tool |
|---|---|---|---|
| Quick one-off measurement | Paste screenshot into Paint | Cmd+Shift+4 crosshair | Open tool, read value |
| Live tracking with copy-paste | Online fullscreen tool | Online fullscreen tool | Online fullscreen tool (native) |
| Measure from static image | Paste into Paint or online tool | Paste into Preview or online tool | Paste into online tool |
| Multi-monitor coordinates | Settings > Display layout | System Settings > Displays | Move mouse across bezels |
| DPI / scaling handling | SetProcessDPIAware() | Multiply by backingScaleFactor | Handled automatically by browser |
| Automation library | PyAutoGUI, AutoHotkey | PyAutoGUI, AppleScript, Hammerspoon | Selenium, Playwright, Cypress |