Maybe you want to get the size for a certain object. Maybe you need to measure a certain vertical or horizontal distance.  Whatever the reason, one tool that can help is Screen Ruler. 

How to measure pixels on your screen with Screen Ruler

Part of Microsoft’s free PowerToys, Screen Ruler will measure a square area, a cross line area, and a vertical or horizontal area. Here’s how it works. Also: How to use the free PowerToys FancyZones in Windows and why you should

Requirements 

If you don’t already have PowerToys on your PC, download and install the PowerToysSetup.exe file from the program’s GitHub page. PowerToys and its tools work the same in both Windows 10 and 11.  Make sure the switch is turned on for Enable Screen Ruler. By default, the activation shortcut to trigger Screen Ruler is Windows key+Shift+M.  You’re best off sticking with the default shortcut as it’s chosen to avoid interfering with other Windows shortcut combinations. But if you need to change it, click the Pencil icon and press a different combination. The tool will tell you if you pick an invalid shortcut. Also: The best graphic design monitors The setting for Per color channel edge detection checks if all the color channels are within a tolerance distance from each other. You can typically leave this turned off. The setting for Pixel tolerance for edge detection can help you more accurately measure certain elements on the screen. For example, Microsoft recommends increasing this value if you need to measure gradients or shadows. The setting for Draw feet on cross adds “feet” to the cross lines, so you can better see them. And the final setting for Line color determines the color of the measurement lines. Red is the default, but you can easily change this if that color conflicts with the color of the screen. Also: The best desktops for graphic design Hold down your mouse button or trackpad and drag to select the area you wish to measure. The number of pixels will change as you draw. When you’ve selected the exact area, note the horizontal and vertical measurements in pixels. Release your mouse button, and the selection will disappear. You can then select another area to measure the pixels. Also: The best laptops for graphic design