Calculators
Everyday calculators for web and general work: percentages, px to rem, aspect ratios and how long a file takes to download at a given speed.
- PX to REM Converter: Pixels to rem, em and points at any base font size, and back.
- Percentage Calculator: Percent of a number, percentage change, and a value plus or minus a percentage.
- Aspect Ratio Calculator: Simplify a width and height to a ratio such as 16:9, and scale to a new size.
- Download Time Calculator: How long a file takes to transfer at a given speed, or the speed a deadline needs.
Which calculator to use
- Percentages: the Percentage Calculator answers the four usual questions: a percentage of a number, what percentage one number is of another, the change between two values, and a value increased or decreased by a percentage.
- CSS sizes: the PX to REM Converter converts between px, rem, em and pt for any root font size.
- Screens and images: the Aspect Ratio Calculator reduces a width and height to a ratio such as 16:9, and scales one side from the other.
- Transfers: the Download Time Calculator works out how long a file takes at a given connection speed, or the speed needed to finish in a given time.
Things that trip people up
- Percentage change is not symmetric. A rise from 100 to 150 is 50 percent, but the fall from 150 back to 100 is 33.3 percent, because the starting value differs.
- rem follows the root font size. 1rem is 16px only while the browser default is unchanged; a user who raises their default size gets larger rem values, which is the point of using them.
- Connection speeds are in bits, file sizes in bytes. A 100 Mbps line moves at most 12.5 megabytes a second, before protocol overhead.
Frequently asked questions
- How do I work out a percentage of a number?
- Multiply the number by the percentage and divide by 100. So 15 percent of 80 is 80 × 15 / 100, which is 12.
- How many pixels is 1rem?
- 1rem equals the root font size, which is 16px in every major browser unless the page or the user changes it. At that size 24px is 1.5rem.
- How do I calculate an aspect ratio?
- Divide the width and the height by their greatest common divisor. For 1920 × 1080 that divisor is 120, giving 16:9.
- Why does my download take longer than the speed suggests?
- Advertised speeds are in megabits per second, so divide by eight for megabytes. Protocol overhead, Wi-Fi and the server at the other end usually take a further share.