What is this calculator for?
You're a designer working on a UI mockup and need to measure pixel distances between elements. Or you're QA-testing a website and need to verify a spacing issue's exact pixel count. The pixel ruler is an on-screen measuring tool — overlay it on your browser or design canvas to read exact pixel distances between elements.
Pixel measurement in design. Standard web design uses CSS pixels (logical pixels that scale with device pixel ratio). Modern Retina/HiDPI displays have 2-3 device pixels per CSS pixel — making a "10px font" still appear as 10px to the user regardless of screen density. Design tools (Figma, Sketch, Photoshop) work in pixels with scaling for export to different device densities. Browser dev tools' inspect panel shows element dimensions in pixels.
This pixel ruler displays a draggable, resizable ruler overlay for measuring distances on screen. For precise measurement of design files: use the design tool's built-in measurement tools (Figma's measurement plugin, Photoshop's ruler tool). For measuring on-screen content in deployed websites: browser dev tools' Inspect Element gives precise pixel coordinates.
How to use this calculator
Activate the ruler. Position over the content you're measuring. Drag the ruler edges to mark distance between two points. Read the pixel measurement.
For web designers: pair with Figma or browser dev tools for cross-checking design implementations. Pixel-perfect designs require matching spacing, sizing, and positioning across mockup and production.
For QA testing: identify visual bugs related to spacing, sizing, alignment. "The button is 4px off center" requires precise measurement to verify and reproduce.
Understanding your results
The ruler returns pixel distance between specified points.
Common UI spacing references. Material Design baseline grid: 8px (most UI elements should be multiples of 8px for visual harmony). Apple Human Interface Guidelines: minimum 44×44 pt for tap targets on iOS (about 44px at 1x display density). Web Content Accessibility Guidelines: minimum 44×44 CSS pixels for interactive elements. Touch-friendly button heights: minimum 44-48px; 56-64px for primary CTAs.
Common font size references for web. Body text: 14-18px (16px is the most common modern default). Small text: 12-14px (legal copy, footnotes). H1: 32-48px desktop; 24-32px mobile. H2: 24-32px desktop; 20-24px mobile. Buttons: 14-16px button text. Hero headlines: 48-72px+ for large impact.
The device pixel density complication. iPhone displays render at 2x or 3x device pixel ratio — 1 CSS pixel = 2 or 3 physical pixels. Designers work in CSS pixels (1x); export designs at 2x or 3x for production. Measuring an image rendered on a high-density display: the on-screen measurement matches CSS pixels even though more physical pixels are used. For most web design work: stick with CSS pixels and let the browser handle density.
Common pixel sizes worth memorizing. iPhone screens: 375 CSS pixels wide (most current models). Standard laptop: 1280-1440 CSS pixels wide (varies). Common desktop monitor: 1920 CSS pixels wide. Tablet portrait: 768 CSS pixels (iPad standard). Tablet landscape: 1024 CSS pixels. Standard responsive breakpoints: mobile under 640px, tablet 640-1024px, desktop 1024-1440px, large desktop 1440+px.
A worked example
Lin is implementing a designer's mockup. Figma file shows: hero title 48px bold, subtitle 20px, button height 56px with 8px corner radius. She needs to verify her CSS implementation matches.
She uses browser dev tools to inspect the deployed elements. Hero title computed CSS: font-size: 48px. Matches design. Subtitle: font-size: 20px. Matches. Button: height: 56px; border-radius: 8px. Matches.
Spacing checks. Designer specified 64px between hero title and subtitle. She measures with pixel ruler (or Inspect): margin-bottom on title is 48px in CSS. Doesn't match. Investigation: she had used the design system's default margin-bottom value (48px) instead of the specific override the designer requested (64px). She updates: margin-bottom: 64px on hero title. Verifies measurement: now 64px. Designer signs off on the visual implementation.
Variation: a marketing manager is reviewing a website and feels the button "looks too small." She inspects with dev tools: button height is 32px. Recommends increasing to 48-56px for better visibility and tap-target accessibility. Designer agrees; updates the implementation. Same screen, same button, but now visually more prominent and accessibility-compliant.
The pixel ruler enables this kind of communication: visual claims ("too small," "off-center," "not consistent") become specific pixel measurements that can be addressed precisely.
Related resources
For color picking and palette in design, see Color Picker and Color Converter. For aspect ratio calculations during image and layout work, the Aspect Ratio Calculator. The Material Design layout guidelines publish the 8dp baseline grid standard; Apple's Human Interface Guidelines specify minimum tap target sizes and other measurement standards for iOS development.