REM to PX Converter - Online Root EM Unit Calculator
Convert REM values to pixels and vice versa based on your root font size. Essential for scalable web typography.
UD5 Toolkit
Responsive CSS Unit Calculator — Convert pixels to relative units instantly
| PX | EM (base: 16px) | REM (root: 16px) |
|---|
PX (pixels) is an absolute unit — one pixel equals one dot on the screen. EM is relative to the font size of its parent element. REM (root EM) is relative to the root <html> element's font size, which defaults to 16px in most browsers. EM can cascade and compound in nested elements, while REM remains consistent throughout the document.
Divide the pixel value by the parent element's font size. Formula: EM = PX ÷ Parent Font Size (px). For example, if the parent font size is 16px and you want 24px, the result is 24 ÷ 16 = 1.5em. Use our converter above for instant calculations.
Divide the pixel value by the root font size (typically 16px). Formula: REM = PX ÷ Root Font Size (px). For example, 32px ÷ 16px = 2rem. If your project uses the 62.5% trick (html { font-size: 62.5%; }), the root size becomes 10px, so 32px ÷ 10px = 3.2rem.
All major browsers set the default root font size to 16px (equivalent to 100% or medium). This means 1rem = 16px unless you explicitly override it in your CSS. Users can change this in their browser settings for accessibility, which is why relative units like REM are recommended for responsive design.
Relative units like EM and REM make your design responsive and accessible. When users change their browser's default font size, REM-based layouts scale proportionally. EM is useful for components that need to scale relative to their parent. PX values are fixed and don't respond to user preferences, potentially causing accessibility issues.
Use REM for global spacing, typography, and layout dimensions that should be consistent relative to the root. Use EM for component-level styling where elements should scale proportionally to their parent — like padding inside a button or margins within a card. For media queries, REM is preferred as it's consistent regardless of nesting.
Setting html { font-size: 62.5%; } makes the root font size 10px (62.5% of 16px = 10px). This simplifies mental math: 1.4rem = 14px, 2.4rem = 24px, etc. However, some developers avoid this trick because it can interfere with user font-size preferences. Modern tools like this converter make it easy to calculate REM values with the default 16px base.
Yes, EM values compound when nested. If a parent has font-size: 1.5em (24px at 16px base) and a child has font-size: 1.5em, the child's font size becomes 36px (24px × 1.5), not 24px. This cascading effect can make EM tricky in deeply nested structures. REM avoids this issue by always referencing the root element.
Convert REM values to pixels and vice versa based on your root font size. Essential for scalable web typography.
Convert pixel values to viewport‑relative units (vw, vh, vmin, vmax) based on a selected breakpoint. Precise responsive design.
Convert pixel values to viewport‑relative units (vw, vh, vmax, vmin) for a specified breakpoint. Includes DVH and SVH. Essential for fluid layouts.
See your website inside iframes at multiple breakpoints simultaneously. Side‑by‑side responsive testing.
Drag a virtual ruler across your screen to measure pixel distances. Horizontal and vertical guides. Useful for UI designers checking alignment.
Find the centroid (center of mass) of any convex polygon by entering vertex coordinates. Useful for physics and design.
Convert volumetric flow rate units: gallons per minute, liters per second, cubic meters per hour. Useful for plumbing and hydraulics.
Paste HTML and see a before/after comparison of minified output. Check the byte savings. All local.
Record your screen, window, or tab with audio directly in the browser. Download the recording as a WebM file. No upload.
Record your screen, window, or tab with audio directly in the browser. Download as WebM. No extension required.
Adjust opacity visually with a slider and see the different CSS representations (opacity property vs RGBA/HSLA). Copy best option.
Turn your browser screen into a full‑color flashlight or strobe. Adjust brightness and color. Simple utility.
Enter a URL and generate a responsive iframe embed code with correct aspect ratio. Supports YouTube, maps, and more.
Paste a user agent string to get a human-readable breakdown of browser, operating system, and device. See your own current agent info automatically.
Count total DOM nodes on the current page and show warnings if limits exceed best practices. Keep the DOM lean.
Play a metronome with adjustable BPM, time signature, and subdivisions (eighth, triplet, sixteenth). Tap tempo and visual flash. Works offline for practice.
Generate a Lit Element web component skeleton with styles and properties. Copy and start coding immediately.
Select any HTML element on a page and capture its screenshot. Download as PNG. Perfect for bug reports. JavaScript API demo.
Tune your guitar using the browser microphone. Detects pitch and shows deviation from standard tuning. No installation, pure client-side audio processing.
A precise online metronome with adjustable BPM, beat emphasis, and time signature. Works offline. Essential for musicians.
Create a reflection effect for images or text using box‑reflect. Adjust direction and offset. Copy the CSS.
Enter any two variables (speed, distance, time) and get the third. Supports mph, km/h, m/s and multiple units. Practical for runners and drivers.
Paste text and align it left, center, right, or fully justify by inserting spaces. Simple formatting helper. Pure browser.
Paste your speech, set time limit, and practice with a pacing indicator (words per minute). Refine delivery.
Register a service worker, subscribe to push, and send a test notification using a VAPID key pair. Step‑by‑step demo.
Track attendance for multiple subjects. Mark present/absent and see percentage. Data in localStorage. Simple student tool.
See a comprehensive table of which modern web APIs your current browser supports. Includes WebGPU, AVIF, and more.
Generate a realistic, random user‑agent string for desktop, mobile, or bot. Perfect for API testing and scraping.
Compare :focus and :focus‑visible styling. See which one applies when using mouse vs. keyboard. Accessible focus management.
Virtual flip coins thousands of times and see the heads/tails ratio converge to 50%. Interactive law of large numbers.