Simplify Your Workflow: Search MiniWebtool.
Add Extension

My Toolbox

Automatic Mode

No saved tools yet.

Go Premium
See also
PT to PX ConverterSCSS to CSS Compiler
Home Page > Webmaster Tools > PX to REM Converter

PX to REM Converter

Convert px to rem, rem to px, px to em and em to px with a custom root font-size. Batch-convert a whole type scale at once, copy ready-to-paste CSS, preview each size at real scale, and see how your rem values respond when a visitor changes their browser font size.

PX to REM Converter
Quick examples — click to fill the form, then press Convert:
Convert a whole scale at once — separate values with commas or spaces (up to 20). Trailing units like 24px are fine.

Embed PX to REM Converter Widget

About PX to REM Converter

The PX to REM Converter turns pixel values into rem or em units — and back again — using whatever root font-size your project actually uses. Paste a single value or a whole type scale, and you get the converted numbers, a copy-ready CSS block with the original pixels preserved as comments, a ruler that renders each size at true scale, and a preview of how your rem values respond when a visitor increases their browser font size.

PX to REM Formula

Converting between pixels and rem is a single division — the only thing you need to know is the root font-size of the document.

px → rem
$$\text{rem} = \frac{\text{px value}}{\text{root font-size}}$$
rem → px
$$\text{px} = \text{rem value} \times \text{root font-size}$$

With the browser default root of 16 px, that gives 24px ÷ 16 = 1.5rem and 1.5rem × 16 = 24px. If your stylesheet sets html { font-size: 62.5%; } the root becomes 10 px and the same 24 px is 2.4rem.

PX to REM Conversion Table (16px root)

Pixelsrem (16px root)rem (10px root)Typical use
8px0.5rem0.8remTight gaps, small badges
10px0.625rem1remFine print, captions
12px0.75rem1.2remLabels, helper text
14px0.875rem1.4remSecondary body text
16px1rem1.6remBase body text
18px1.125rem1.8remLead paragraph
20px1.25rem2remSmall heading, h5
24px1.5rem2.4remh4, card title
28px1.75rem2.8remh3
32px2rem3.2remh2, section title
36px2.25rem3.6remh2 on desktop
40px2.5rem4remh1 on mobile
48px3rem4.8remh1, page title
56px3.5rem5.6remHero heading
64px4rem6.4remDisplay heading
72px4.5rem7.2remLarge display
80px5rem8remMarketing hero
96px6rem9.6remOversized display

rem vs em: Why Nesting Changes Everything

rem is measured against the root element (html), so it means the same thing everywhere in the document. em is measured against the parent element's computed font-size, so identical em values compound as you nest them. This diagram shows the same 1.5 multiplier applied three levels deep, starting from a 16 px root:

✅ rem — stays predictable
.level-1 { font-size: 1.5rem } 24px
.level-2 { font-size: 1.5rem } 24px
.level-3 { font-size: 1.5rem } 24px
Always 1.5 × 16px root = 24px, no matter how deep.
⚠ em — compounds each level
.level-1 { font-size: 1.5em } 24px
.level-2 { font-size: 1.5em } 36px
.level-3 { font-size: 1.5em } 54px
16 × 1.5 = 24, × 1.5 = 36, × 1.5 = 54px — runaway text.

The practical rule most teams land on: use rem for font sizes, layout spacing and breakpoints; use em deliberately for things that should scale with their own component, such as the padding inside a button or the size of an icon sitting next to text.

Why Use rem Instead of px?

  • Accessibility. A visitor who sets their browser's default font size to 20 px sees every rem-based size grow proportionally. Sizes hard-coded in px ignore that preference completely.
  • One knob for global scaling. Change the root font-size in a media query and your whole type scale and spacing rhythm shift together — no per-component overrides.
  • Consistent spacing rhythm. Expressing padding and margins in rem keeps the vertical rhythm tied to the type scale instead of drifting apart.
  • Design-token friendly. Modern design systems (and Tailwind's default scale) publish sizes in rem, so converting your existing px values makes handoff easier.

The 62.5% Root Font-Size Trick

Many teams add this rule so that 1rem equals a clean 10 px, which makes mental conversion trivial:

html { font-size: 62.5%; }  /* 16px × 0.625 = 10px */
body { font-size: 1.6rem; } /* back to a readable 16px */

.card-title { font-size: 2.4rem; } /* 24px */
.card-body  { font-size: 1.4rem; } /* 14px */

Because 62.5% is a percentage of the browser default rather than a fixed pixel value, it still honours the visitor's font-size preference. The one thing to remember is to reset body back to roughly 1.6rem, otherwise your default text ships at 10 px. Set the root font-size field above to 10 to convert against this setup.

rem in Media Queries

Inside a media query, rem is resolved against the browser's initial root font-size — not the html font-size you set in CSS. So @media (min-width: 48rem) is always 768 px, even if your stylesheet declares html { font-size: 10px }. That makes rem breakpoints safe and predictable, and it is one of the few places where em and rem behave identically.

When You Should Still Use px

  • Hairline borders and dividers — a 1 px border should stay 1 px; scaling it produces blurry sub-pixel lines.
  • Fixed-size assets — sprite offsets, precise shadow offsets, and images with a known intrinsic size.
  • Canvas and print output — where a physical or device-pixel measurement is genuinely what you mean.

How to Use This Converter

  1. Pick a direction: px → rem, rem → px, px → em or em → px.
  2. Enter your values: one number, or a whole scale separated by commas or spaces (up to 20 at a time). Trailing units such as 24px are accepted and ignored.
  3. Set the root font-size: keep 16 for browser defaults, or tap a preset chip for 10 (62.5% trick), 12, 14, 18 or 20.
  4. Click Convert: read the results table, the true-scale size ruler, the accessibility preview and the CSS block.
  5. Copy the CSS: one button copies every font-size declaration with the source pixel value kept in a comment.

Frequently Asked Questions

How do I convert px to rem?

Divide the pixel value by the root font-size. With the browser default root of 16 px, 24 px ÷ 16 = 1.5rem. To go the other way, multiply the rem value by the root font-size: 1.5rem × 16 = 24 px.

How many px is 1rem?

1rem equals the root font-size of the page. In every major browser that defaults to 16 px, so 1rem is 16 px unless the html element or the visitor's browser settings change it.

What is the difference between rem and em?

rem is always relative to the root font-size on the html element, so 1.5rem is the same size anywhere in the document. em is relative to the font-size of the element's own parent, so nested elements compound: 1.5em inside another 1.5em renders at 2.25 times the base size.

What is the 62.5 percent root font-size trick?

Setting html { font-size: 62.5%; } makes the root 10 px instead of 16 px, so 1rem equals 10 px and the mental maths becomes trivial: 24 px is 2.4rem. It still scales with the visitor's browser font-size preference because 62.5% is relative, not an absolute pixel value.

Should I use px or rem for font sizes?

Use rem for font sizes, spacing and media queries so the layout grows when a visitor raises their default browser font size. Reserve px for values that must not scale, such as hairline borders, one-pixel dividers and some shadow offsets.

Do rem values need to be round numbers?

No. Browsers handle fractional rem values fine and compute sub-pixel sizes internally. If you prefer clean numbers, pick a root font-size that divides your scale evenly, such as 10 px or 8 px, or use this converter's decimal precision option.

Does rem work for padding, margin and media queries?

Yes. rem is valid anywhere CSS accepts a length, including padding, margin, width, gap and border-radius. In media queries rem is resolved against the initial 16 px root rather than your custom html font-size, so a 48rem breakpoint is always 768 px.

Additional Resources

Reference this content, page, or tool as:

"PX to REM Converter" at https://MiniWebtool.com/px-to-rem-converter/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: August 9, 2026

Webmaster Tools:

Top & Updated:

Instagram User ID LookupRandom PickerRandom Name Picker WheelImage ResizerFacebook User ID LookupLine CounterSort NumbersRSD Calculator - Relative Standard DeviationFPS ConverterRemove SpacesSun, Moon & Rising Sign Calculator 🌞🌙✨Random Quote GeneratorMAC Address Lookup🖱️ Click CounterJob FinderWord to Phone Number Converter⬛ Aspect Ratio CalculatorRandom Credit Card Generator📷 OCR / Image to TextMAC Address GeneratorERA CalculatorMerge VideosJulian Date ConverterSHA256 Hash GeneratorPercent Off CalculatorStandard Error CalculatorSquare Root (√) CalculatorSum CalculatorCm to Feet and Inches ConverterRoman Numerals ConverterSlope and Grade CalculatorBatting Average CalculatorMP3 LooperWeight Loss CalculatorAdd Text to ImageIP Subnet CalculatorRandom Fake Address GeneratorNumber of Digits CalculatorBCD ConverterVertical Jump CalculatorName RandomizerAudio SplitterBitwise CalculatorRandom Writing Prompt GeneratorInvisible Text GeneratorFeet and Inches to Cm ConverterImage SplitterRandom Superpower GeneratorLog Base 10 CalculatorRandom IMEI GeneratorPhone Number ExtractorRandom Truth or Dare GeneratorText FormatterRandom Activity GeneratorSalary Conversion CalculatorOctal CalculatorHalfway Date CalculatorMaster Number CalculatorVideo CompressorLunar Calendar ConverterNumber to Word ConverterCaffeine Overdose CalculatorCompound Growth CalculatorYouTube Channel StatisticsRandom Poker Hand GeneratorQuotient and Remainder CalculatorSun Position CalculatorLong Division CalculatorFirst n Digits of PiSHA512 Hash GeneratorRandom Movie PickerLeap Years ListFraction CalculatorBinary to Gray Code ConverterEmail ExtractorMultiplication CalculatorRandom Meal GeneratorBolt Torque CalculatorEstimation CalculatorMagic 8-BallHebrew Calendar ConverterRandom Video Thumbnail Generator🔍 Plagiarism CheckerFile Size ConverterEquation of a Line CalculatorWord Ladder GeneratorOutlier CalculatorRandom Birthday GeneratorCompare Two StringsStair CalculatorBingo Card GeneratorMD5 Hash GeneratorLove Compatibility CalculatorLimit CalculatorOPS CalculatorImage CompressorModulo CalculatorFlip VideoPercent Growth Rate CalculatorVideo to Image ExtractorURL ExtractorLong Multiplication CalculatorRandom Emoji GeneratorRandom Loadout GeneratorAstrological Element Balance CalculatorBroken Link CheckerList of Prime NumbersMultiple Fraction CalculatorList Randomizer🎰 Gacha Pity CalculatorAPI TesterInequality Solver🔊 Tone GeneratorOrder of Operations Calculator (PEMDAS)📅 Date CalculatorWHIP CalculatorArc Length CalculatorAI Language DetectorDay of Year CalendarRandom User-Agent GeneratorRandom Tournament Bracket GeneratorCone Flat Pattern (Template) GeneratorBcrypt Hash Generator / CheckerPaycheck Calculator (Take-Home Pay)Number ExtractorWAR CalculatorIP Address to Hex ConverterName Number Calculator📊 Bar Graph MakerRandom Line PickerAdd Prefix and Suffix to TextSigma Notation Calculator (Summation)Day of the Year Calculator - What Day of the Year Is It Today?eBay Fee CalculatorPercent to PPM ConverterWhat is my Zodiac Sign?Chinese Gender PredictorSocial Media Username CheckerBreak Line by CharactersRandomize NumbersDomain and Range CalculatorSaturn Return CalculatorRandom Number PickerSlugging Percentage CalculatorSum of Positive Integers CalculatorImage CropperScientific Notation to Decimal ConverterAdjust Video SpeedYouTube Tag ExtractorRandom Object GeneratorConnect the Dots GeneratorOn Base Percentage CalculatorSocial Media Post Time OptimizerColor InverterRandom Chord GeneratorRandom Math Problem GeneratorAI Text HumanizerRemove Lines Containing...Algebraic Expression SimplifierDMS to Decimal Degrees ConverterWhat is my Lucky Number?Whitespace VisualizerAI Punctuation AdderTrigonometric Equation SolverSquare Numbers ListLogarithmic Equation SolverRadical SimplifierAcreage CalculatorDecibel (dB) CalculatorImage EnhancerMercury Retrograde CalendarLottery Number GeneratorSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾Remove AccentField Goal Percentage CalculatorArithmetic Sequence CalculatorWord Scramble GeneratorHeight Percentile CalculatorPER CalculatorRatio to Percentage CalculatorAudio ExtractorLED Resistor CalculatorScientific Notation CalculatorProportion CalculatorVocabulary Quiz GeneratorBattery Life CalculatorWater Usage CalculatorRemove Leading Trailing SpacesRandom Excuse GeneratorRemove Empty LinesWHOIS LookupLbs to Kg ConverterQuote FinderRandom Group GeneratorWire Resistance CalculatorRandom PIN GeneratorStandard Deviation CalculatorTime Duration CalculatorVideo SplitterAverage Deviation CalculatorHypotenuse Calculator1099 Tax CalculatorEffect Size CalculatorLogic Gate SimulatorBCD to Decimal ConverterGray Code to Binary ConverterAI ParaphraserBinary to BCD ConverterSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterBCD to Hex ConverterMedian CalculatorAverage CalculatorPVIFA CalculatorReverse VideoRemove Audio from VideoActual Cash Value CalculatorAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderHex to Decimal ConverterConvolution CalculatorMAC Address AnalyzerRandom String GeneratorMarkup CalculatorPVIF CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorBoiling Point CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hôpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorBernoulli Equation CalculatorSurfboard Volume CalculatorTennis Grip Size CalculatorBackpack Size CalculatorCelsius to Fahrenheit ConverterFahrenheit to Celsius ConverterKm to Miles ConverterMiles to Km ConverterMM to Inches ConverterInches to MM ConverterStone to Kg ConverterKg to Stone ConverterLiters to Gallons ConverterGallons to Liters ConverterML to Oz ConverterOz to ML ConverterSquare Meters to Square Feet ConverterSquare Feet to Square Meters ConverterCubic Feet to Cubic Yards ConverterCubic Meters to Cubic FeetKnots to MPH ConverterMPH to KMH / KMH to MPHMg to Ml ConverterAI Text SummarizerAI TranslatorAI Story GeneratorAI Poem GeneratorAI Song Lyrics GeneratorMcg to Mg ConverterIndian Land Unit ConverterTola to Gram ConverterPX to REM ConverterPT to PX ConverterMerge PDFSplit PDFCompress PDFPDF to JPGJPG to PDFRotate PDFDelete PDF PagesAdd Page Numbers to PDFProtect PDFReorder PDF PagesPDF Word CounterPDF Page ExtractorPDF to Text ExtractorUnlock PDF (Owner-Password Removal)PDF Flatten ToolAI Rap Lyrics GeneratorAI Cover Letter GeneratorAI Resume Bullet GeneratorAI LinkedIn Headline & Bio GeneratorAI Instagram Caption GeneratorAI YouTube Title & Description GeneratorAI Video Script GeneratorAI Product Description GeneratorAI Press Release GeneratorAI Wedding Speech GeneratorAI Thank-You Note GeneratorAI Dream InterpreterRandom Question GeneratorWould You Rather GeneratorNever Have I Ever GeneratorIcebreaker Question GeneratorCharades GeneratorPictionary Word GeneratorHangman Word GeneratorTrivia Question GeneratorRandom Fact GeneratorRandom Joke GeneratorDad Joke GeneratorPickup Line GeneratorCompliment GeneratorDaily Affirmation GeneratorJournal Prompt GeneratorDrawing Idea GeneratorFortune Cookie GeneratorFantasy Name GeneratorCapacitor Bank Sizing CalculatorSolar Charge Controller Sizing CalculatorBattery C-Rate CalculatorBattery Internal Resistance CalculatorPeukert Battery Runtime CalculatorPCB Via Current CalculatorBand Name GeneratorRap Name GeneratorNickname GeneratorTeam Name GeneratorGamertag GeneratorConvert Video for Twitter (X)