{"content":{"intro":"The CSS Unit Converter turns a size in pixels into rem, em and points, using a base font size you can change. It's made for web designers and developers moving between design files and stylesheets.","sections":[["px, rem and em","Pixels are fixed. A rem is relative to the root font size of the page, which is 16 px in most browsers, so 24 px is 1.5 rem. An em is relative to the font size of the element itself, so its value depends on where it's used; the tool assumes the same base size for both."],["Why rem is better for accessibility","If a user increases the default font size in their browser settings, sizes set in rem grow with it, while sizes set in px stay fixed. Using rem for text and spacing makes a site more comfortable for people who need larger text."],["Points","A point is 1/72 of an inch, and CSS defines a pixel as 1/96 of an inch, so 1 px equals 0.75 pt. Points are mainly used for print stylesheets and documents."]],"faqs":[{"q":"How many pixels is 1 rem?","a":"16 px by default, but it follows the root font size, so it changes if the page or the user sets a different size."},{"q":"What is 12 pt in pixels?","a":"16 px, since 1 pt equals 4/3 of a pixel."},{"q":"Should I use em or rem?","a":"Use rem for consistent sizing across the page. Use em when you want something to scale with its own element's font size, like padding on a button."}]},"sfaq":[{"q":"Why use rem instead of px in CSS?","a":"rem scales relative to the root font size, which respects a user's browser accessibility settings, making rem-based layouts more accessible than fixed pixel values."}],"copy":{"explain":"Every value is converted to pixels first: rem and em multiply by the base font size, pt divides by 0.75, % is a share of the base size, and vw and vh are a share of the viewport width or height you enter. Then it's converted to every other unit.","example":"24px at a 16px base → 1.5rem · 1.5em · 18pt · 150% · 1.6667vw on a 1440px-wide screen. Switch the unit to rem and type 2 to get 32px. The preview shows &quot;Aa&quot; at that size, and the table lists common sizes from 12px to 64px with their typical uses.","intro":"The CSS Unit Converter turns any size between px, rem, em, pt, %, vw and vh, using a base font size and viewport size you can change. It shows a live preview of the size, and a table of common sizes, body text, headings, hero text, in px, rem and pt.","sections":[["px, rem and em","Pixels are fixed. A rem is relative to the root font size of the page, which is 16px in most browsers, so 24px is 1.5rem. An em is relative to the font size of the element itself, so its value depends on where it's used; the tool uses the same base size for both."],["vw and vh","1vw is 1% of the browser window's width and 1vh is 1% of its height. They're handy for full-screen sections and fluid headings. Enter the screen size you're designing for, such as 390 × 844 for a phone or 1440 × 900 for a laptop, to see what a value works out to."],["Why rem is better for accessibility","If a user increases the default font size in their browser, sizes set in rem grow with it, while sizes set in px stay fixed. Using rem for text and spacing makes a site more comfortable for people who need larger text."]],"faqs":[{"q":"How many pixels is 1 rem?","a":"16px by default, but it follows the root font size, so it changes if the page or the user sets a different size."},{"q":"What is 12pt in pixels?","a":"16px, since 1pt equals 4/3 of a pixel."},{"q":"Should I use em or rem?","a":"Use rem for consistent sizing across the page. Use em when you want something to scale with its own element's font size, like padding on a button."}]},"feat":[["Seven CSS units","px, rem, em, pt, %, vw and vh, converted together."],["Your own base","Set the root font size and viewport size your site uses."],["Live preview","See how big the size actually looks."],["Common sizes table","Body text, headings and hero text in px, rem and pt."]],"faqx":[{"q":"What is 14px in rem?","a":"Divide the pixel value by the root font size. At the default 16px base, 14px is 14 / 16 = 0.875rem. Select px, type 14 and the rem row shows the answer; change the base slider if your site uses a different root size."},{"q":"What are vw and vh units?","a":"1vw is 1% of the viewport width and 1vh is 1% of the viewport height. On a 1440px-wide screen, 1vw is 14.4px. Enter your own viewport width and height to see how a vw or vh size works out on that screen."},{"q":"Why is 1px equal to 0.75pt?","a":"CSS defines 1 inch as 96 pixels and a point is 1/72 of an inch, so 1px equals 72 / 96 = 0.75pt. To go from pt to px, divide by 0.75: 18pt is 24px. Points are mostly used for print stylesheets."},{"q":"What does % mean in this converter?","a":"Here % means a font size relative to the base size, so 150% at a 16px base is 24px. In real CSS, a percentage font size is relative to the parent element's font size, and a percentage width is relative to the parent's width, not the font."},{"q":"Why is my em size bigger than the converter shows?","a":"The converter assumes the parent's font size equals the base. In real pages, em multiplies by the parent's font size, so nested elements compound: 1.2em inside 1.2em at a 16px base is about 23px, not 19.2px. Use rem to avoid this."},{"q":"What is the 62.5% font-size trick?","a":"Setting html { font-size: 62.5% } makes the root size 10px in browsers with the default 16px setting, so 1.6rem equals 16px and maths is easier. Set the base slider to 10px to convert with this setup."},{"q":"What viewport size should I enter for mobile?","a":"Phones report a CSS viewport width much smaller than their screen resolution, and many Android phones fall between about 360px and 412px wide. Enter the width you are designing for to check how vw values will look on phones."},{"q":"Why does the preview stop getting bigger?","a":"The live preview is capped at 96px so it fits on the page, and the label says capped at 96px when your size is larger. The converted values themselves are not capped and are correct for any size."}]}