10px to REM
10px = 0.625rem at the default 16px root font size. Change the root size below if your project uses a different base.
By Mohamed Farhan · Updated Oct 19, 2026
10px = 0.625rem at a 16px root font size
10px at other root font sizes
The formula
rem stands for "root em": a size relative to the font size of the html element. To convert, divide pixels by the root font size.
rem = px / root font size
10 / 16 = 0.625rem.title {
font-size: 0.625rem; /* 10px */
}Nearby conversions
Where 10px is used
10px is the smallest size you will see in most interfaces, and it should be used sparingly. It appears in tiny labels on charts, badge counters, legal fine print and keyboard shortcut hints. At 10px, text is hard to read for many people, so keep it for supplementary information that is also available elsewhere. As a spacing value, 10px is common in older designs that were not built on a 4px or 8px grid.
10px in type and spacing scales
- On an 8px grid, 10px is 1.25 units, so it sits off the grid; 8px is the nearest grid value.
- On a 4px grid, 10px is 2.5 units, between 8px and 12px.
- In Tailwind, there is no default font-size class for 10px, so use text-[0.625rem], and the spacing scale covers it as step 2.5 (p-2.5, gap-2.5).
- As em, 10px is 0.714em inside 14px text, 0.625em inside 16px text and 0.556em inside 18px text.
- As a percentage of the default 16px font size, 10px is 62.5%.
Line height and spacing for 10px text
If you use 10px (0.625rem) for body or interface text, a line-height of about 1.5 works well, which gives 15px between baselines. Longer paragraphs benefit from slightly more (1.6 to 1.7), while buttons and labels can go tighter (1.2 to 1.3).
For spacing below a block of 10px text, a margin of 0.75em to 1em (7.5px to 10px) keeps the rhythm consistent with the text size. Writing these values in em ties them to the font size, so they adjust automatically if the text size changes.
A fluid 10px with clamp()
Instead of a fixed 0.625rem, you can let the size scale smoothly between a smaller value on phones and 10px on desktops. The CSS clamp() function takes a minimum, a preferred value and a maximum. The example below grows from 10px on a 375px-wide screen to 10px on a 1280px-wide screen, and never goes outside that range. Because the minimum and maximum are in rem, the size still respects the user's font settings.
.title {
font-size: clamp(0.625rem, 0.625rem + 0vw, 0.625rem);
}Why rem instead of px
A rem is relative to the root font size, so 0.625rem stays equal to 10px only while the root is 16px. When someone raises the default font size in their browser, say to 20px, the same 0.625rem becomes 12.5px, and your layout scales with it. A hard-coded 10px stays at 10px and ignores that preference.
That matters for accessibility. Many people with low vision rely on larger default text, and the WCAG resize text guideline expects content to remain usable when text is scaled up to 200 percent. Using rem for type and spacing is the simplest way to support that without extra work.
Common conversion mistakes
- Assuming the root is always 16px. If your CSS sets html { font-size: 62.5% }, 10px is 1rem, not 0.625rem. Check the root before converting.
- Converting borders. Keep 1px borders and hairlines in px; converting them to tiny rem values can make them render inconsistently.
- Rounding too aggressively. Values like 0.8125rem look odd but are exact. If you round them, round to your spacing grid rather than to one decimal place.
- Mixing units for the same role. If font sizes are in rem but margins are in px, spacing will not scale with text.
A worked example with 10px
Here is how 10px might appear in real CSS. The card title uses 0.625rem, spacing uses rem values from the same 16px base, and the border stays in px so it remains a crisp hairline. If a visitor's default font size is 20px, the title grows to 12.5px and the spacing grows with it, while the border stays 1px.
.card-title {
font-size: 0.625rem; /* 10px */
line-height: 1.5;
margin-bottom: 0.5rem; /* 8px */
}
.card {
padding: 1.5rem; /* 24px */
border: 1px solid #e7e5e4; /* stays px */
}Converting in Sass, CSS variables and JavaScript
If you convert values often, let your tools do it. In Sass, a small function such as rem($px) that returns math.div($px, 16px) * 1rem turns rem(10px) into 0.625rem at compile time. In plain CSS, you can keep the pixel value readable with calc(10 / 16 * 1rem), which modern browsers resolve to 0.625rem.
In JavaScript, for example when generating inline styles or design tokens, divide by the root font size: 10 / 16 = 0.625. If you need the live root size (for users who changed their default), read parseFloat(getComputedStyle(document.documentElement).fontSize) instead of assuming 16.
Naming 10px as a design token
Design systems rarely use raw numbers in components. Instead, 10px would live in a token such as --font-size-sm for type or --size-10 for spacing, defined once as 0.625rem. Components then reference the token, so a later change to the scale updates every use at once.
If your team uses Figma variables or a tokens file (for example in the W3C design tokens format), store the value in px for designers and generate the rem version in the build step. That keeps both sides speaking the same language while the shipped CSS stays accessible.
How browsers resolve rem
When the browser computes a rem value, it multiplies it by the computed font size of the html element. That font size starts from the user's default (16px unless they changed it), then applies whatever your CSS sets on html. So 0.625rem means "0.625 times the root size", and it is resolved once per page, unlike em, which is recalculated at every level of nesting.
Because the root is shared, rem values are predictable across the whole document: a 0.625rem gap in a sidebar is exactly the same size as a 0.625rem gap in a modal, regardless of the text size inside each.
// Sass
@use "sass:math";
@function rem($px, $base: 16px) {
@return math.div($px, $base) * 1rem;
}
.card { padding: rem(10px); } // 0.625rem
/* CSS */
.card { padding: calc(10 / 16 * 1rem); }
// JavaScript
const root = parseFloat(getComputedStyle(document.documentElement).fontSize);
const rem = 10 / root; // 0.625 at a 16px rootSources and further reading
- MDN: CSS length units · Definitions of px, rem, em and other length units.
- MDN: font-size · How font sizes and relative units are computed.
- MDN: clamp() · The CSS function used for fluid type.
- WCAG 2.1: Resize Text · Why text must scale up to 200% without breaking.
- Tailwind CSS: font-size · Tailwind's default type scale in rem.
Skip the unit math
Inspo AI generates responsive React + Tailwind screens with a consistent rem-based type and spacing scale built in.
More conversions
Questions people ask
How many rem is 10px?
10px is 0.625rem when the root font size is 16px, which is the default in every major browser.
How do I convert 10px to rem?
Divide the pixel value by the root font size: 10 / 16 = 0.625rem. If your root font size is different, divide by that number instead.
What is 10px in Tailwind?
In Tailwind's spacing scale 10px is step 2.5, so p-2.5, m-2.5 or gap-2.5. For font size use text-[0.625rem].
Why use rem instead of 10px?
rem scales with the user's browser font size setting, so layouts stay accessible for people who need larger text. px stays fixed regardless of that setting.
Is 10px a good font size?
10px is too small for most reading and best kept for fine print. See the line-height guidance above for pairing it with spacing.
What is 10px in em?
Inside text with a 16px font size, 10px is 0.625em. em is relative to the element's own font size, so the value changes if the parent text size changes.

↘ Building Inspo AI | AI-Powered Design Research & Builder Platform | Design Engineer.