Tailwind Spacing to PX Converter
Convert Tailwind CSS spacing steps (p-4, gap-8, m-12…) to exact pixels and rem.
What Is Tailwind Spacing to PX Converter?
Tailwind CSS spacing utilities (padding, margin, gap, width, height) use a default scale built on 0.25rem increments. At a 16px root font size, each step equals step × 4 pixels. This converter maps any Tailwind step to exact px and rem values, with support for a custom root font size when you have changed html { font-size }.
How to Convert Tailwind Spacing to PX?
Multiply the Tailwind spacing step by (root font size ÷ 4). At the default 16px root, that is step × 4. The px step is always 1px flat. Half-steps (0.5, 1.5, 2.5, 3.5) equal 2px, 6px, 10px, and 14px at 16px root. rem = step × 0.25 for all numeric steps.
How to use the Tailwind Spacing to PX converter
- 1
Pick a spacing step from the dropdown (e.g. 4, 8, 12) or type any numeric step. The scale matches Tailwind's default spacing utilities.
- 2
Set your root font size if you changed html { font-size } (default is 16px). Pixels and rem update instantly.
- 3
Copy the px or rem result, or grab a utility class like p-4, gap-8, or m-12 for your markup.
Tailwind Spacing to PX Formula
Tailwind Default Spacing Scale: PX & REM at 16px Root
| Step | Pixels | REM | Example Class |
|---|---|---|---|
| 0 | 0px | 0rem | p-0 |
| px | 1px | n/a | p-px |
| 0.5 | 2px | 0.125rem | p-0.5 |
| 1 | 4px | 0.25rem | p-1 |
| 1.5 | 6px | 0.375rem | p-1.5 |
| 2 | 8px | 0.5rem | p-2 |
| 2.5 | 10px | 0.625rem | p-2.5 |
| 3 | 12px | 0.75rem | p-3 |
| 3.5 | 14px | 0.875rem | p-3.5 |
| 4 | 16px | 1rem | p-4 |
| 5 | 20px | 1.25rem | p-5 |
| 6 | 24px | 1.5rem | p-6 |
| 7 | 28px | 1.75rem | p-7 |
| 8 | 32px | 2rem | p-8 |
| 9 | 36px | 2.25rem | p-9 |
| 10 | 40px | 2.5rem | p-10 |
| 11 | 44px | 2.75rem | p-11 |
| 12 | 48px | 3rem | p-12 |
| 14 | 56px | 3.5rem | p-14 |
| 16 | 64px | 4rem | p-16 |
| 20 | 80px | 5rem | p-20 |
| 24 | 96px | 6rem | p-24 |
| 28 | 112px | 7rem | p-28 |
| 32 | 128px | 8rem | p-32 |
| 36 | 144px | 9rem | p-36 |
| 40 | 160px | 10rem | p-40 |
| 44 | 176px | 11rem | p-44 |
| 48 | 192px | 12rem | p-48 |
| 52 | 208px | 13rem | p-52 |
| 56 | 224px | 14rem | p-56 |
| 60 | 240px | 15rem | p-60 |
| 64 | 256px | 16rem | p-64 |
| 72 | 288px | 18rem | p-72 |
| 80 | 320px | 20rem | p-80 |
| 96 | 384px | 24rem | p-96 |
Reverse with PX to Tailwind Spacing or convert px to rem with PX to REM.