CSS Units Converter (px ↔ rem ↔ em ↔ pt ↔ cm ↔ mm ↔ in)
**CSS length units split into two families**: **absolute units** (px, pt, pc, cm, mm, in — fixed at draw time) and **relative units** (rem follows the root html element's font-size, em follows the nearest ancestor's — the basis of responsive typography). This tool implements the W3C *CSS Values Level 3* conventions 1 in = 96 px and 1 pt = 1/72 in, plus separate knobs for *root* and *parent* font sizes so designers and front-end engineers can align design-system tokens, Tailwind scales, print sizes and Figma specs in a single view.
Enter a finite value and positive root / parent font sizes.
Equivalent values
- px
- —
- rem
- —
- em
- —
- pt
- —
- pc
- —
- cm
- —
- mm
- —
- in
- —
Formula
Absolute (CSS Values L3 §6.2): 1 in = 96 px 1 pt = 1/72 in = 4/3 px 1 pc = 12 pt = 16 px 1 cm = 96/2.54 px ≈ 37.795 px 1 mm = 1/10 cm ≈ 3.7795 px Relative: 1 rem = root font size (default 16 px) 1 em = parent element font-size (defaults to root)
- · **Why 1 in = 96 px**: CSS defines the px as the "reference pixel" — 1/96 in on a 96-dpi display. Modern high-density screens (Retina, OLED) render internally at higher resolution but a CSS px is always 1/96 in, which is what makes print-style CSS and design specs portable across devices.
- · **rem vs em — different reach**: (a) **rem** always tracks the html element's font-size — so the whole page's typography scale shifts when you change one number; (b) **em** tracks the nearest ancestor's font-size and *compounds* in nested elements (two layers of 1.2em → 1.44em), which is easy to accidentally explode. **Design-system convention**: rems for spacing and font-size, ems for local element padding / line-height so they ride along with the local font-size.
- · **When to reach for px vs rem**: (a) **px** for visually fixed elements — 1 px borders, shadow blur radii, icon stroke widths; (b) **rem** for typography and spacing — font-size, margin, padding, gap — so the page scales with the user's root font preference (browser default 16 px, but the user can change it). Tailwind's rem-based scale (1 unit = 0.25 rem = 4 px) is rem-based for exactly this reason.
- · **pt and cm mostly belong inside print CSS** — @page, @media print: A4 = 210 × 297 mm = 595 × 842 pt (at 72 dpi) = 794 × 1123 px (at 96 dpi). **Using pt on-screen** freezes font sizes — they no longer scale with the user's root font preference, which is an accessibility regression for low-vision users.
- · **The 16 px default**: W3C CSS2 (1998) never mandated it, but Mozilla, WebKit and Trident all converged on 16 px — ~1/6 in on a 96-dpi screen (4.23 mm), comparable to printed 12 pt Times New Roman. Readability research (Tinker 1963, Rello & Baeza-Yates 2016) puts the comfortable English reading band at 14–18 px. **Accessibility caution**: forcing html { font-size: 12px; } overrides users who have raised their browser default (e.g. 20 px for visual accessibility); rem-based pages would otherwise scale up cleanly.
- · **References**: (1) W3C CSS Values and Units Module Level 3 (2021), §6.2 *Absolute Lengths*; (2) W3C CSS Values and Units Module Level 4, §5 *Font-relative Lengths*; (3) MDN Web Docs — CSS Length, em, rem; (4) Tinker, M. A. (1963), *Legibility of Print*, Iowa State University Press; (5) Rello, L. & Baeza-Yates, R. (2016), "The Effect of Font Type on Screen Readability by People with Dyslexia", *ACM Transactions on Accessible Computing*.
Frequently asked
My Figma spec says 14 pt for body text — what does that translate to in CSS?
**Direct conversion**: 14 pt = 14 × 4/3 px = **18.667 px** = **1.167 rem** at the default 16 px root font. **In practice you round**: 18 px / 1.125 rem is visually indistinguishable from 18.667 px and avoids sub-pixel anti-aliasing that softens edges. **Better advice**: Figma designers reach for pt out of print habit, but expressing the spec as a design token (e.g. `--text-body: 1.125rem` or Tailwind's text-lg) keeps the value rem-based, so it scales with the user's accessibility font setting *and* matches the designer's intent. **One caveat**: SF Pro / Helvetica on Apple platforms visually weighs slightly heavier than Roboto at the same px size — cross-platform specs should use a *relative scale ratio* (e.g. 1, 1.125, 1.25) rather than a single hard-coded px value.
I often see `.container { padding: 1em 2em; }` in legacy CSS — is em a risky choice?
**Not risky, but you have to understand its *compounding* behaviour.** em follows the nearest ancestor's font-size, so `<div style="font-size: 20px"><p style="font-size: 1.2em">` makes the p 24 px, and a `<span style="font-size: 1.2em">` inside it becomes 28.8 px — sizes multiply. **When em still earns its place**: (a) **padding / margin that should scale with the font** — button { padding: 0.5em 1em } stays proportional as the button's font-size changes; (b) **line-height in em** is more predictable than px; (c) **icons sized 1em** match cap height. **When to switch to rem**: (a) overall typography scale; (b) layout spacing; (c) media-query breakpoints. **Tailwind's rule of thumb**: all utility classes use rem (the spacing scale 4 = 1rem = 16 px) for predictability, but components can still reach for em internally on icons and buttons.
Does 1 cm in CSS really equal 1 physical cm? Holding a ruler against my screen says no.
**It is not *physical* 1 cm — it is the CSS-spec "reference 1 cm" = 96 / 2.54 px ≈ 37.8 px.** **Why it does not equal a real cm**: (a) screen DPI varies widely — a 1080p 24" monitor ≈ 92 dpi, a 4K 13" laptop ≈ 340 dpi, an iPhone 15 Pro = 460 ppi — if CSS cm followed physical length, every layout would shift between devices; (b) when CSS was specified in 1996 the assumed *reference monitor* was 96 dpi, so 1 cm only matches a real centimetre on 96-dpi screens; (c) iOS / Android use device-pixel-ratio to make a CSS px equal 2 or 3 device pixels, then the OS rasterises — so 1 CSS cm is close to a physical cm on iPhone, but might be half that on a Windows 4K display. **Takeaway**: **do not use cm or mm for on-screen sizing** — use px or rem; reserve cm / mm and pt for print CSS (inside @page or @media print).
Related tools
Length Unit Converter
Cm, m, km, in, ft, yd, mi — common length units, converted instantly.
Temperature Converter
Convert between Celsius (°C), Fahrenheit (°F) and Kelvin (K) instantly.
Shoe Size Converter (US / UK / EU / CM)
Enter your foot length or a size in any system to see the equivalent US / UK / EU and centimetre sizes.
Paper Size Reference
Pick a paper size (A0–A10, B / C series, Letter, Legal, card sizes) to see its mm / cm / inch / pixel dimensions.
Number Base Converter (Binary / Octal / Decimal / Hex)
Convert a number simultaneously between binary, octal, decimal and hexadecimal — useful for programmers, students and electronics work.
Aspect Ratio & Screen Size Calculator
From an aspect ratio and one side, find the other; or from a diagonal and ratio, get real width and height (4:3, 16:9, 21:9 …).
Data Storage Unit Converter (B/KB/MB/GB/TB)
Convert between bytes, KB, MB, GB, TB and PB — distinguishing decimal (1000-base, drive labels) from binary (1024-base, OS-reported).
RGB ↔ HEX ↔ HSL Color Converter
Convert between HEX (#RRGGBB), RGB(0–255) and HSL(0–360, 0–100, 0–100) instantly — with a live colour preview swatch.
Tire Size Calculator (Spec / Diameter / Speedometer Error)
Convert a P-metric tire spec (e.g. 225/65R17) into sidewall height, overall diameter, circumference and revolutions per km — and compare against a reference size to see speedometer error.
Energy Unit Converter (J / kJ / cal / kcal / kWh / BTU / Wh)
Convert between joules, kilojoules, calories, kilocalories, kilowatt-hours, BTU and watt-hours in a single view — for nutrition labels, electricity bills, heating and fuel comparisons.
Pressure Unit Converter
Convert between Pa, kPa, bar, mbar, atm, psi, mmHg, Torr and inHg in a single view — all the everyday pressure units.
Torque Unit Converter
Convert between N·m, kgf·m, kgf·cm, lbf·ft, lbf·in and ozf·in — all the torque units used on torque wrenches, bicycle bolts and car service specs.
Angle Unit Converter
Convert between degrees, radians, gradians, turns, arcminutes, arcseconds, milliradians and NATO mil — with live sin/cos/tan values for reference.
Fuel Economy Converter (MPG ⇄ L/100km)
Convert between L/100km, km/L, US MPG and UK (imperial) MPG — compare car efficiency figures across regions without arithmetic.
Power Unit Converter
Convert between W, kW, MW, mechanical horsepower (hp), metric horsepower (PS), BTU/hr, ft·lbf/s, cal/s, kcal/h and refrigeration tons in one view.
px ↔ rem ↔ em Converter
Pick a root font-size (defaults to 16 px) and convert any CSS pixel, rem, em, percentage or point value into the others, with a reference table for common sizes.
Alcohol ABV ↔ Proof Converter & Standard Drinks Calculator
Convert alcohol by volume (ABV %) to US proof and UK proof, plus compute grams of pure alcohol and "standard drinks" per pour for US / UK / AU / HK.
Bandwidth & Throughput Converter (Mbps ↔ MB/s)
Convert network bandwidth (kbps, Mbps, Gbps) to file-transfer rate (KB/s, MB/s, MiB/s) and estimate how long a given file size takes.
Weight / Mass Unit Converter
Kilograms, grams, milligrams, pounds, ounces, stones, tonnes, jin and tael — common mass units, converted instantly.
Battery mAh ↔ Wh Converter (Power Bank Airline Rules)
Enter battery capacity (mAh) and voltage (V) to get watt-hours (Wh) instantly — with a live IATA airline check (100 Wh / 160 Wh cut-offs).
International Bra Size Converter
Enter underbust and bust (or pick a local size) to convert bra sizes across US, UK, EU, AU and JP standards.
International Ring Size Converter
Enter inner circumference (mm) or diameter to cross-reference US, UK, EU, JP and HK ring sizes.
Area Unit Converter
Square metres, hectares, acres, square feet, square miles and more — common area units, converted instantly.
Volume / Capacity Unit Converter
Litres, millilitres, cubic metres, US and imperial gallons, quarts, pints, fluid ounces, cups, tablespoons and teaspoons — converted instantly.
Speed Unit Converter
Convert freely between km/h, mph, m/s, ft/s, knots and Mach number.
Color Contrast Ratio (WCAG) Calculator
Enter foreground and background hex colors to compute the WCAG 2.x contrast ratio (1:1 to 21:1) and see whether the pair passes AA / AAA accessibility levels for normal and large text.
AWG Wire Size Calculator
Look up the diameter (mm), cross-sectional area (mm²), resistance per kilometre and safe ampacity for any American Wire Gauge (AWG) size — handy for low-voltage wiring design.
Frequency Unit Converter (Hz / kHz / MHz / GHz)
Convert between Hz, kHz, MHz, GHz, THz, RPM and BPM — one input fills every other unit instantly.
Force Unit Converter (N / kN / lbf / kgf / dyne)
Convert between newtons (N), kilonewtons (kN), pound-force (lbf), kilogram-force (kgf), dyne and ounce-force (ozf) — bridging SI, imperial and CGS force units used in physics and engineering.
Magnetic Flux Density Converter (T / mT / µT / Gauss)
Convert magnetic flux density between tesla (T), millitesla (mT), microtesla (µT), gauss (G) and milligauss (mG) — handy for comparing MRI fields, Earth field, speakers and lab magnets across very different scales.
Volumetric (Dimensional) Weight Calculator (Air / Courier)
Enter parcel length × width × height and DIM divisor (IATA air 6000 cm³/kg, express 5000, UPS/FedEx US 139 in³/lb) to compute volumetric weight and compare it with actual weight to find the chargeable weight.
Polar ↔ Cartesian Coordinate Converter
Convert Cartesian (x, y) ↔ polar (r, θ) coordinates in either direction with a degree/radian toggle — useful for math, physics, engineering and game-development work.
Astronomical Distance Converter (ly / pc / AU / km)
Enter any distance and the tool converts it across metres, kilometres, miles, Earth–Moon distance, astronomical units (AU), light-years, parsecs and light-travel time — useful for astronomy, science fiction and classroom prep.
Map Scale Distance Converter
Enter a scale ratio (e.g. 1:25 000) and a measured map distance; the tool returns the real-world distance, or works in reverse from real distance to map distance — useful for hiking, map reading and town planning.
DMS ↔ Decimal Degrees Converter
Two-way conversion between degrees–minutes–seconds (D° M′ S″) and decimal degrees — the standard need when juggling GPS coordinates, astronomy, surveying and marine navigation. Supports signed values for south latitude and west longitude.
Hat Size Converter (Head Circumference → US/UK/EU/JP)
Enter your head circumference (cm or inches); the tool maps it to US (fitted and fractional), UK, EU (cm) and Japanese hat sizes plus the S/M/L/XL range — useful for buying New Era caps, fedoras, baseball caps and helmet liners online.
kW ⇄ Horsepower Converter (kW / HP / PS)
Convert between kilowatt (kW), mechanical horsepower (HP), metric horsepower (PS / cheval-vapeur), brake horsepower (BHP), and foot-pound-force per second — the standard unit set for cars, engines, generators and power tools across UK / US / EU / JP markings.
Lumens ⇄ Lux Converter (lm ⇄ lx)
Enter the luminous flux (lumens, lm) of a fixture and the lit area; the tool returns the illuminance (lux = lm/m²) and can solve for the lumens required to hit a target lux — used for room lighting design, photography, grow lights and workplace illuminance planning.
Wheel Rolling Distance & RPM Calculator
Enter wheel diameter (or circumference) and RPM (or speed); the tool applies C = π·d to return rolling distance per revolution, distance per minute and the matching road speed (km/h, mph) — useful for bikes, cars, conveyors, gears and physics class.
Megapixels ⇄ Print Size Calculator (DPI / PPI)
Enter image pixels (e.g. 24 MP or 6000 × 4000) and target print resolution (300 DPI photo, 240 DPI relaxed, 150 DPI poster); the tool returns the maximum print size in inches and cm, and works in reverse to find the megapixels needed for a desired print — a workhorse for photo printing, poster design and album layout.
BPM ↔ Milliseconds Delay Calculator (Music Tempo)
Enter a track's BPM and the tool returns the millisecond delay time for every common note value — whole, half, quarter, eighth, sixteenth, thirty-second — plus dotted and triplet variants. Essential for producers setting echo, reverb pre-delay and sidechain timing in any DAW.
Video Bitrate ↔ File Size Calculator
Enter video duration (minutes), video bitrate (Mbps) and audio bitrate (kbps); the tool computes the resulting file size in GB ⁄ MB and runs the inverse: given a target file size, what bitrate fits. Handy for YouTube uploads, streaming budgets and estimating SD-card / cloud-storage requirements.
Morse Code ↔ Text Converter
Enter text or Morse code; the tool converts in either direction using the ITU-R M.1677-1 international Morse alphabet (letters, digits and standard punctuation), with conventional 3-space letter gaps and 7-space word gaps. Standard reference for amateur radio (HAM), scouting and emergency-comms training.
Beaufort Wind Scale Calculator (Force 0–12)
Enter wind speed in any unit (m/s, km/h, mph or knots); the tool maps it to Beaufort force 0–12 per the WMO standard, with the official sea-state and land-condition description. The international shorthand for sailors, hikers, aviators and outdoor sports.
R-Value ↔ U-Value Insulation Converter
Enter R-value (thermal resistance) or U-value (thermal transmittance); the tool flips them via U = 1 ⁄ R and converts between SI (m²·K/W) and US (ft²·°F·h/BTU) units — the foundational conversion for roof, wall and window insulation specifications.
Paper Weight Converter (gsm ↔ lb bond / cover / text)
Enter a paper weight in either GSM (metric grammage) or US-system pounds (bond, cover, text, index or tag) and the tool converts in both directions via the basis-weight ratio, plus shows typical use cases (copy paper, business cards, posters, magazine covers) — handy for print buying, design specs and comparing imported paper stock.
Slope / Grade Converter (Percent ↔ Degrees ↔ Rise:Run)
Slope can be expressed three ways: percent grade (rise⁄run × 100 %), degrees (arctan(rise⁄run)) or ratio (1:N). Enter any one and the tool instantly converts to the other two — useful for hiking, cycling, road signs, accessibility ramps and roof pitch.
Blood Glucose Unit Converter (mg/dL ↔ mmol/L)
Enter a blood glucose value; the tool converts between mg/dL and mmol/L — the two globally-used units (mg/dL in the US, mmol/L in Europe, China, Hong Kong and elsewhere). Essential when reading lab reports across borders.
HbA1c Unit Converter (NGSP % ↔ IFCC mmol/mol)
Enter your HbA1c value; the tool converts between NGSP units (%) and IFCC units (mmol/mol) — both are used in clinical practice worldwide, and diabetes monitoring requires reading reports in the right unit.
Cholesterol Unit Converter (mg/dL ↔ mmol/L)
Enter total cholesterol, LDL, HDL or triglycerides; the tool converts between mg/dL and mmol/L using the standard conversion factors (38.67 for cholesterol classes, 88.57 for triglycerides) — useful when reading US-style and European-style lipid panels.
Gas Concentration Converter (ppm ↔ mg/m³)
Enter a gas concentration (ppm or mg/m³), molecular weight, temperature and pressure; the tool converts in both directions via the ideal-gas law — used in indoor air quality, occupational safety (OSHA / NIOSH PELs) and environmental monitoring.
Diopter ↔ Focal Length Converter
Enter diopters (D) or focal length (mm / m / inch); the tool converts both ways via P = 1 / f(m) — used for eyeglass prescriptions, myopia / presbyopia correction, close-up filters and magnifier ratings.
Time Unit Converter (seconds / minutes / hours / days / weeks / months / years / centuries)
Enter a duration in any unit (seconds, minutes, hours, days, weeks, months, years, decades, centuries, millennia) and the tool converts to every other unit simultaneously — using year = 365.25 days (IAU Julian) and month = 30.4375 days.
Luminous Efficacy (Watts ↔ Lumens) Calculator
Enter the lamp wattage W and luminous efficacy (lm / W) — or known lumens and efficacy — and the tool uses lm = W × η to convert between input power and light output, with built-in reference efficacies for incandescent, halogen, CFL and LED bulbs — essential when picking the right LED brightness to replace an old wattage bulb.
Adult Clothing Size Converter (US / UK / EU / JP)
Pick gender (men / women) and garment type (tops / bottoms), enter any region size; the tool instantly returns the matching US, UK, EU and JP sizes alongside the standard bust / chest / waist range — essential for online shopping, travel and overseas purchases.
Gold Karat Purity Converter (K ↔ % ↔ fineness)
Enter the karat (24K = pure), percent purity, or millesimal fineness (999 = pure); the tool simultaneously shows all three values and the international hallmark grade it corresponds to (e.g. 750, 585, 375) — useful for buying jewellery, scrap-gold valuation and customs checks.
Frame Rate (FPS) ↔ Frame Duration Converter
Enter a frame rate (24 / 25 / 29.97 / 30 / 60 / 120 fps or custom) and clip duration; the tool reports frame duration (ms), total frames, and cross-references industry standards — film, PAL, NTSC, web, high-speed — useful for post-production, animation timing and game-engine work.
Image File Size Calculator (uncompressed + JPEG / PNG estimate)
Enter image width, height, colour mode (grayscale / RGB / RGBA / CMYK) and bit depth (8 / 10 / 12 / 16 bit); the tool returns the uncompressed raw size and estimates for high-quality JPEG, standard JPEG, low-quality JPEG and lossless PNG.
Water Hardness Unit Converter (gpg ↔ ppm ↔ mmol/L ↔ °dH)
Enter water hardness in any unit (gpg, ppm/mg-L CaCO₃, mmol/L, German degrees °dH, French °fH, English °eH); the tool converts to all other units at once and classifies the water as soft, moderately hard, hard or very hard.
Density Unit Converter (kg/m³ ↔ g/cm³ ↔ lb/ft³ ↔ lb/gal)
Enter density in any unit; the tool converts to kg/m³, g/cm³ (= g/mL), lb/ft³, lb/US gal, lb/UK gal and kg/L at once — useful in engineering design, chemistry labs and shipping payload calculations.
Volumetric Flow Rate Converter (L/min ↔ gal/min ↔ m³/h ↔ ft³/s)
Enter a volumetric flow rate in any unit (L/s, L/min, m³/h, US gpm, UK gpm, ft³/s (cfs), ft³/min (cfm), etc.); the tool converts to all the other common units at once — handy for pumps, HVAC, fire-protection and irrigation work.
Radiation Dose Unit Converter (Sv / Rem / Gy / Rad)
Convert between effective-dose units (Sievert, Rem, mSv, µSv, mrem) and absorbed-dose units (Gray, Rad, mGy) using the standard 1 Sv = 100 Rem and 1 Gy = 100 Rad ratios — essential for radiation safety, medical imaging and nuclear-engineering work.
Viscosity Unit Converter (Pa·s ↔ Poise ↔ cP ↔ Stokes)
Convert between dynamic viscosity (Pa·s, Poise, cP, lbf·s/ft²) and kinematic viscosity (m²/s, Stokes, cSt) — essential for fluid mechanics, lubricants, chemical engineering and food processing.
Acceleration Unit Converter (m/s² ↔ ft/s² ↔ g ↔ Gal)
Convert instantly between metres-per-second² (SI), feet-per-second² (imperial), g (standard gravity 9.80665 m/s²), gal (CGS, used in geophysics), km/h-per-second and mph-per-second — essential for physics class, vehicle testing, seismology and aerospace.
Refrigeration Ton Converter (Ton ↔ kW ↔ BTU/h ↔ kcal/h)
Convert refrigeration capacity between US tons of refrigeration (TR / RT), kilowatts (kW), BTU/h, kcal/h and horsepower — essential for HVAC sizing, chiller specs and data-centre heat-load estimation.
Metal Hardness Converter (Vickers ↔ Brinell ↔ Rockwell C ↔ Tensile Strength)
Enter a hardness value in Vickers (HV), Brinell (HB) or Rockwell C (HRC); the tool converts to the other two scales and the approximate ultimate tensile strength (UTS, MPa) using the ASTM E140 / ISO 18265 conversion table — essential for heat-treatment work, mechanical engineering and QA on steels.
Capacitance Unit Converter (F ↔ mF ↔ μF ↔ nF ↔ pF)
Convert between farads (F), millifarads (mF), microfarads (μF), nanofarads (nF) and picofarads (pF) — instantly. The grid below shows every unit at once for quick cross-reference. Essential for circuit design, datasheet reading and decoding legacy schematics that still use "mfd" or "MFD".
Volumetric Flow-Rate Converter (L/s ↔ m³/h ↔ GPM ↔ CFM)
Convert between common volumetric flow-rate units (L/s, L/min, m³/h, m³/s, US GPM, UK GPM, CFM, CFS, barrels/day) — essential for water treatment, HVAC, chemical engineering, irrigation and oil & gas.
Color Temperature Mired Converter (Kelvin ↔ Mired)
Convert between color temperature (K) and mireds (M = 10⁶ / K), with reference values for common sources (candle, tungsten, daylight, overcast) — essential for photography filters, cinema lighting and smart-LED tuning.
Height Converter (Feet & Inches ↔ cm / m)
Enter feet + inches (e.g. 5'10") or cm / m and the tool returns all three forms simultaneously — the one-to-one conversion between the US / UK foot-and-inch height format and metric cm / m, suited for medical records, visa forms, athlete profiles and apparel sizing.