Convert pixels to em units instantly with this free CSS converter. Adjust parent font size and watch the px to em conversion update in real time.
| Unit | Value | |
|---|---|---|
| pxPixel | 16 | |
| ptPoint | 12 | |
| pcPica | 1 | |
| cmCentimeter | 0.42333333 | |
| mmMillimeter | 4.2333333 | |
| inInch | 0.16666667 | |
| remRoot em | 1 | |
| emEm | 1 | |
| vwViewport width | 1.1111111 | |
| vhViewport height | 1.7777778 | |
| vminViewport minimum | 1.7777778 | |
| vmaxViewport maximum | 1.1111111 | |
| exx-height (approx) | 2 | |
| chCharacter width (approx) | 1.6666667 |
Enter a pixel value to convert it to em units. The conversion divides your pixel value by the parent element font size (default 16px). Unlike rem, em follows the nearest parent, which makes it ideal for components that scale as a unit.
| Pixels | Em | Use Case |
|---|---|---|
| 12px | 0.75em | Small print inside a card |
| 14px | 0.875em | Secondary text |
| 16px | 1em | Matches parent exactly |
| 20px | 1.25em | Lead paragraph |
| 24px | 1.5em | Card heading |
| 32px | 2em | Hero text inside a banner |
em multiplies down the tree. Three nested levels of 1.2em produce 1.728em at the leaf (1.2 x 1.2 x 1.2). This surprises developers styling nested lists and menus. Two fixes: set the multiplying factor on one level only, or use rem for the outer containers and em only inside the leaf component.
A button has 16px text and the design calls for 12px vertical padding. 12 / 16 = 0.75em, so padding: 0.75em scales automatically if the button text grows to 20px. Fixed px padding would stay small while the text grows.
For root relative units try Px to Rem, or see every unit in the full CSS Units Converter.
Nothing you paste leaves this tab. Every tool runs entirely in your browser β no upload, no server, no account.