About
Tool No. 40 of Pikkola
Four converters that share one page because they share one habit: a value means nothing until its unit is written down. Each tab does its own arithmetic, and each one shows the working, so a number can be checked instead of trusted.
What it does
- Data sizes in SI units (KB, MB, GB, TB) and IEC units (KiB, MiB, GiB, TiB), converted into every other unit at once, with the byte and bit count.
- Transfer time from a file size and a line rate, with an option that spends 85% of the line the way a real transfer does, and a table of the same file at the usual rates.
- CSS lengths between px, rem, em, pt, vw and vh at a root size, a parent size and a viewport that you set, plus a table of the sizes people type most.
- A clamp() declaration built from a smallest and largest size and the two viewport widths where they apply, with a live line of text as the window width moves.
- An aspect ratio resizer with the usual ratios locked, the width and height reduced by their greatest common divisor, the decimal value and the familiar name.
- Pixel density from a resolution and a diagonal, with the dot pitch and the physical size.
- Binary, octal, decimal and hexadecimal in BigInt precision, the low 8, 16, 32 or 64 bits drawn as a strip, and both the signed and unsigned reading of them.
Bytes, counted two ways
The SI prefixes step by ten: a kilobyte is 1,000 bytes, a megabyte a million, a gigabyte a thousand million. The IEC prefixes step by two: a kibibyte is 1,024 bytes, a mebibyte 1,048,576. Both are correct, and they disagree by 2.4% at the first step and about 10% by the terabyte, which is why a drive sold as 1 TB shows roughly 931 GB in an operating system that counts in twos.
This page keeps the two families in separate columns and never mixes them. A decimal amount is turned into an exact byte count before anything is shown: 1.5 MB is 1,500,000 bytes, and 1.5 MB is also 1,500 KB, without floating point noise in the last digit. When the input and the factor are both whole numbers the byte count is held as a BigInt, so a terabyte stays an integer instead of drifting.
Transfer time is the bit count divided by the bit rate. A byte is eight bits, so 1 GB at 100 Mbps is 80 seconds on paper, and 94 seconds at the 85% setting. Headers, acknowledgements, congestion control and the server's own disk all take a share, which is why the calculator offers that setting rather than pretending the line is perfect.
Pixels, rem and the middle term
A rem is measured from the root font size, an em from the element's own size, a pt is 1/72 inch and therefore 4/3 of a CSS pixel, and a vw is one percent of the viewport width. The tab takes one value in one of those units, converts it to px, and then shows the px value in all of them at the root size and viewport you set. Change the root size from 16 to 18 and every rem figure moves with it, which is exactly what will happen on the page where you paste it.
The clamp() generator fits a straight line between two points: the smallest size at the smaller viewport, and the largest size at the larger one. The slope in vw is (max − min) divided by (wide − narrow) times 100, and the intercept is the smallest size minus the slope times the narrow width. The result is written as clamp(min, calc(intercept + slope vw), max), with the sizes divided by the root size so the whole line survives a user who changes their browser font size.
Ratios and density
A ratio is reduced by the greatest common divisor, so 1920 by 1080 becomes 16 by 9 because 120 divides both. The page also divides the two numbers for the decimal value, and compares it with the familiar ratios within half a percent, which is enough to name a 1366 by 768 screen as 16:9 without claiming it is exact.
Pixels per inch is the diagonal in pixels divided by the diagonal in inches. The dot pitch is 25.4 mm divided by that density, and the physical size falls out of the same division. A 27 inch 1920 by 1080 screen is 81.6 PPI with a 0.31 mm pitch; the same resolution on a 24 inch screen is denser, and the same panel at 4K nearly doubles it.
Four bases, and the top bit
A number is parsed digit by digit into a BigInt, so the digits are exact at any length: a 20 digit hexadecimal value is still a value, not an approximation. Each base is written from that integer, binary in groups of four, octal in threes, hexadecimal in fours.
The bit view masks the value to the chosen width and draws the bits in rows of eight. The unsigned reading is the masked value itself; the signed reading, in two's complement, subtracts two to the power of the width when the top bit is set. So in 8 bits, 11111111 is 255 or -1 depending only on how you read it, and 10000000 is 128 or -128.
What it deliberately does not do
- It does not know your line. The transfer time is arithmetic on the rate you type, not a measurement of your connection.
- It does not read your page. The CSS tab converts the number you give it; it cannot see the computed font size on a site you have open.
- It does not check a file. The data tab converts sizes and cannot tell you whether a particular file is 700 MB.
- It does not convert currencies, temperatures, cooking measures or anything whose factor is a matter of policy rather than arithmetic.
- It does not store anything on a server. The last values you typed are kept in this browser so the page opens where you left it, and nowhere else.
- No account, no upload, no analytics, no cookies, no fonts or scripts from another server.
Why it is free
Pikkola builds small tools that do one job and keeps them free, with no account and no advertising. A static page that does arithmetic in the browser costs almost nothing to serve, so there is no reason to charge for it.
Contact
A figure that reads wrong, a phrase that reads badly in Korean or Japanese, a unit that should be in a list and is not: hello@pikkola.com. Send the value, the unit and what you expected to see.