Why file sizes need to become bits

Storage tools show sizes in bytes and their multiples, while links, radios and serial ports are rated in bits per second. To estimate how long a 250 KiB web page needs on a 2 Mbit/s connection, or to size a buffer for a serial protocol, you have to put both numbers in the same unit. The usual path is KiB to bytes to bits, with two multiplications that are easy to slip on. This page performs the whole step in one go: enter the size in kibibytes, keep the target unit on bit, and read the count. The result then divides directly into a line rate to give a transfer time in seconds.

The 8,192 factor

The IEC prefix kibi stands for 2^10, which is 1,024, and the byte is eight bits. So one KiB holds 1,024 × 8 = 8,192 bits, and the page applies bit = KiB × 8,192. The reverse direction divides by 8,192, so a single bit is about 0.0001220703125 KiB. The prefixes kibi, mebi and gibi were standardized by the IEC to separate binary multiples from the decimal kilo, mega and giga. They are listed in the NIST guide to the SI under the section on binary prefixes. Keeping the i in the symbol KiB tells readers the count is a multiple of 1,024, not 1,000.

Ten kibibytes as a bit count

Ten kibibytes is 10,240 bytes, and 10,240 × 8 gives 81,920 bits, which is the value the page returns. A size like this is typical for a small icon, a short text file, or a settings blob stored in a device. If you had used the decimal kilobyte instead, 10 kB would be 80,000 bits, so the gap is 1,920 bits, or 2.4 percent. The difference is small at this size and grows with each larger prefix. The result is exact because the factor is an integer, so there is no rounding in the display and the number can be copied into a calculation without adjustment. The same ten kibibytes, converted with the 8,000 bits per decimal kilobyte, would have understated the payload on a link that moves binary-sized blocks.

Microcontroller memory in bits

Chip datasheets for memory often describe capacity in bits, while firmware tools report it in kibibytes. A 32 KiB flash array holds 262,144 bits, and a 4 KiB page holds 32,768 bits. Embedded engineers use those numbers to confirm that a design fits and to compute checksum or error-correction overhead per page. If a memory vendor lists a part as 256 Kbit, dividing by 8,192 gives 32 KiB, which agrees with the flash size shown in the compiler output. Enter 32 here to confirm the bit count against a datasheet before ordering parts, and check the reverse path for a vendor who quotes bits only.

TCP windows and throughput ceilings

The receive window of a TCP connection limits how much data can be in flight. A 64 KiB window equals 524,288 bits. With a round-trip time of 50 ms, one window per round trip allows 524,288 bits every 0.05 seconds, about 10.49 Mbit/s at most, regardless of how fast the link is. Network engineers use this quick calculation to explain why a long-distance transfer stays slow on a fast line. Entering 64 KiB here gives the bit count for the numerator, and dividing by the round-trip time in seconds returns the ceiling in bit/s. Window scaling raises the limit, but the arithmetic stays the same.

Download time from a page weight

A web page weighing 250 KiB carries 2,048,000 bits. On a 2 Mbit/s link, where mega means one million, the transfer takes about 1.02 seconds, ignoring protocol overhead and connection setup. Doubling the page weight doubles the time, and halving the bandwidth does the same. Developers use this arithmetic to set performance budgets: a budget of 100 KiB for a mobile page corresponds to 819,200 bits and about 0.41 seconds on that same link. Note that line rates use decimal mega, while the page size is binary, so a consistent conversion keeps the estimate honest to within the usual overhead of headers and retransmissions. If the link is rated in megabytes per second instead, multiply the page size in bytes by the same factor of 1,024 first and divide by the rate directly, skipping the bit count altogether.

Serial links, buffers and framing

On a UART or SPI bus, the time to send a block depends on its bit count plus framing bits. A 1 KiB buffer holds 8,192 data bits, but an asynchronous serial frame sends 10 bits for every 8 data bits when it includes a start bit and a stop bit, so the line carries 10,240 bits for that buffer. At 115,200 baud this takes about 0.089 seconds. The converter handles the first part of that calculation. Add the framing yourself afterward. Having the raw data bit count in front of you helps when you decide buffer sizes or debug a driver that seems to run slower than the line rate suggests. For a 115,200 baud port, the usable payload is 11,520 bytes per second, which equals 11.25 KiB per second, and that figure answers most questions about how quickly a log dump will scroll past.

Firmware updates over a slow radio link

Low-power wireless devices often move data at a few thousand bits per second. A 128 KiB firmware image holds 1,048,576 bits. On a link that delivers 5,000 bit/s of usable payload, an illustrative figure, the transfer takes about 210 seconds, or three and a half minutes, before retries. Doubling the image size doubles the time, and so does halving the rate. Product teams use this calculation to decide whether an over-the-air update is practical or whether a technician must visit the device. Enter the image size in KiB here, divide by the payload rate you measured, and add the time lost to acknowledgments and retransmissions.

Where bit and byte labels go wrong

Lowercase b stands for bit and uppercase B for byte, a convention in the SI and IEC guidance that is often ignored on packaging and in apps. A product that says 100 Kb per second moves one eighth as many bytes as one that says 100 KB per second. Before using any figure, confirm whether it is KiB, kB, Kib or kbit, since the same digits can differ by a factor of 8 or by 2.4 percent. This page expects binary kibibytes as its input, so a size given in decimal kilobytes should be converted first with the kB option in the menu, which keeps the result consistent with the standard definitions.