18px → REM
18px to REM - 1.125rem at 16px Base
At the default browser root size of 16px, 18px equals
1.125rem. Formula: rem = px ÷ 16.
Last reviewed:
CSS snippet
.example {
font-size: 1.125rem; /* 18px at 16px root */
padding: 1.125rem;
} PX to REM formula
rem = px ÷ root font size
18px ÷ 16px = 1.125rem Worked example: To convert 18px at a 16px root,
divide 18 by 16.
18 ÷ 16 = 1.125. Write font-size: 1.125rem;
instead of font-size: 18px; so text scales when users enlarge their browser default font size.
Common use cases at 18px (1.125rem)
| Category | Tailwind / design use | CSS property example |
|---|---|---|
| Font size | text-lg (1.125rem) | font-size: 1.125rem; |
| Spacing | - | padding: 1.125rem; |
| Gap / margin | - | gap: 1.125rem; |
Nearby pixel conversions
Also see 16px to rem
and 20px to rem
.
18px to REM FAQ
How do you convert 18px to rem?
Divide 18 by the root font size. At the default 16px base: 18 ÷ 16 = 1.125rem. Formula: rem = px ÷ root font size. Paste font-size: 1.125rem; into your CSS so typography scales when users change their browser default font size.
What is 18px in rem at 16px base?
At a 16px root font size, 18px equals exactly 1.125rem. This is the browser default unless your project or the user changes html { font-size }. If your root differs, scale with rem = 18 ÷ yourRootPx before shipping production styles.
Should I use 1.125rem or 18px in CSS?
Use 1.125rem for typography and spacing that should scale with the user's root font-size preference - important for accessibility. Reserve 18px for fixed values like 1px borders or bitmap image dimensions. Prefer rem for layout rhythm so zoom and OS font settings do not clip text.
How do I convert 1.125rem back to pixels?
Multiply 1.125rem by 16: 1.125 × 16 = 18px. Reverse formula: px = rem × root font size. Use that when a design tool exports rem tokens and you need pixel sizes for image assets, canvas drawing, or developer handoff docs.
Where is 18px commonly used in web design?
18px (1.125rem) maps to text-lg (1.125rem) in typical design systems. For Tailwind spacing, see -. Check the use-case table on this page for CSS property examples covering font-size, padding, and gap so you can pick a consistent token across components and breakpoints.
Full converter
PX to REM Converter - any value, custom base
Cheat sheet
PX to REM cheat sheet - 12px through 64px