# CSS unit converter > How many pixels is that in rem? Convert CSS lengths between px, rem, em, pt, pc, in, cm, mm and Q at your font size. Free CSS unit converter: px to rem, em, pt and back at any root font size, plus inches, cm, mm, picas and Q, following the W3C CSS Values spec. - Page: https://how.box/css-units/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/css-units/?v={v}&from={from}&to={to}&fs={fs} - `v` (number 0 to 1e15): The CSS length to convert, in the from unit. Example: `1`. - `from` (px, rem, em, pt, pc, in, cm, mm or q): Unit of v (unit id: px, rem, em, pt, pc, in, cm, mm, q). Example: `rem`. - `to` (px, rem, em, pt, pc, in, cm, mm or q): Unit to convert to (unit id). Example: `px`. - `fs` (number 1 to 400): The font size in CSS px that 1 em and 1 rem stand for (1 to 400). Example: `16`. Example answer: https://how.box/css-units/?v=1&from=rem&to=px&fs=16 A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `css_units_convert`: Converts a CSS length between units using exact definitions (1 in = 96 px = 2.54 cm, 1 pt = 1/72 in = 4/3 px, 1 pc = 16 px, 1 cm = 96/2.54 px, 1 mm = 1/10 cm, 1 Q = 1/40 cm; 1 rem and 1 em = the font size in px (context, default 16); W3C CSS Values and Units Level 4 §6). - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"css_units_convert","arguments":{"value":1,"from_unit":"rem","to_unit":"px","context":16}}}` - GET: https://how.box/mcp/run/css_units_convert?value=1&from_unit=rem&to_unit=px&context=16 ## How it works CSS has absolute lengths, fixed to each other, and font-relative ones. In CSS, an inch is always 96 px, so 1 pt (1/72 in) is 4/3 px, a pica is 16 px and 1 cm is about 37.8 px. These CSS pixels are not the screen's physical pixels; the browser scales them. A rem is the font size of the root element and an em the font size of the element itself. Browsers default to 16 px, so rem = px ÷ 16 and 24 px = 1.5 rem. If your root font size is 20 px, 24 px is 1.2 rem. The converter uses the one font size you set for both, so for em, give the size that applies to that element. The definitions come from the W3C CSS Values and Units Module Level 4. Viewport and container units (vw, vh, cqw) depend on the screen and are not included. ## FAQ **How many pixels is 1 rem?** 16 px at the browsers' default font size. It changes with the root font size, for example 10 px when html { font-size: 62.5% }. **What is the difference between em and rem?** rem always uses the root (html) font size; em uses the font size of the element it is on, so nested ems multiply. **How many pixels is 12 pt?** 16 px: a point is 1/72 inch and a CSS inch is 96 px. **Is a CSS pixel always one screen pixel?** No. CSS pixels are reference units. The device pixel ratio and zoom determine how many physical pixels render one CSS pixel. **Can I convert vw or vh here?** No. They depend on the viewport dimensions. This converter supports fixed CSS lengths and em/rem at the font size you supply. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)