frontendhack-logo
0.125rem = 2px

At the default root font size of 16px, 0.125rem is exactly 2px.

Calculation based on a root font-size of 16 pixels.

How to convert 0.125rem to px

To convert rem to pixels, multiply the rem value by the root font size: px = rem × 16. For 0.125rem that is 0.125 × 16 = 2px.

2px is a very small size, typically used for borders, hairlines, icon gaps and fine detail. It is often used for thin borders, outlines and tiny gaps.

0.125rem at different root font sizes

Root font sizeInputResult
10px0.125rem1.25px
12px0.125rem1.5px
14px0.125rem1.75px
15px0.125rem1.875px
16px0.125rem2px
18px0.125rem2.25px
20px0.125rem2.5px
22px0.125rem2.75px
24px0.125rem3px

CSS examples

font-size: 0.125rem; /* 2px */
padding: 0.125rem;
margin-bottom: 0.125rem;
width: 0.125rem;

The same values in pixels, if you need a fixed size:

font-size: 2px;
padding: 2px;

Tailwind CSS equivalent

The default spacing scale has a step for 0.125rem: use classes like p-0.5, m-0.5, gap-0.5, w-0.5 and h-0.5.

Nearby values

REMPixels
0.0625rem1px
0.1rem1.6px
0.125rem2px
0.1875rem3px
0.2rem3.2px
0.25rem4px
0.3rem4.8px
0.3125rem5px

Frequently Asked Questions

0.125rem equals 2px when the root font size is the browser default of 16px. The calculation is 0.125 × 16 = 2.

2px equals 0.125rem at a 16px root font size (2 ÷ 16 = 0.125).

Yes. rem is relative to the root font size, so 0.125rem becomes 2.25px at an 18px root and 2.5px at a 20px root. Use the base font size field above to try any value.

Prefer rem for font sizes, spacing and layout so they respect the user's browser font settings and scale for accessibility. Use px for details that should never scale, such as 1px borders or fixed icon sizes.