UNIT RECONCILIATION

Checking a bit count against a byte count

A byte holds eight bits, so the same stored data gives a count eight times larger in bits than in bytes. This guide checks that factor and shows how to avoid reading one count as the other.

Eight bits make one byte

A bit is a single binary digit, 0 or 1. A byte is a group of eight bits, which can take 256 different values. The converters on this site use that definition. The term octet is used in networking standards for the same eight-bit group, because historically some computers used bytes of other sizes. Eight bits became the standard through widespread hardware design, and it matches the 256 values needed for a character in many early encodings. With this definition, the conversions are simple multiplications and divisions by 8, and both directions give a whole number whenever the starting count is a multiple of the right factor, as 800 is for 8. A count in bytes multiplied by 8 gives bits, and a count in bits divided by 8 gives bytes.

Running the factor in both directions

The worked cases show a quantity of 800 bits converting to 100 bytes, and 800 bytes converting to 6,400 bits. The same digits appear in both cases, yet the stored amounts differ by a factor of eight, which is the cost of reading one unit as the other. A useful check is direction: going from the smaller unit to the larger unit must make the number smaller, and going the other way must make it larger. If a converted file size grows when you go from bits to bytes, the factor was applied backward. Extending the pair, 1 byte is 8 bits, and a 5 megabyte file, using the decimal megabyte of 1,000,000 bytes, holds 40,000,000 bits.

The letter case carries the unit

Abbreviations separate the two units by case. A lowercase b stands for bit and an uppercase B for byte, so Mb is megabit and MB is megabyte, and kb is kilobit while kB is kilobyte. This convention is followed in the IEC and IEEE guidance on binary prefixes, but it relies on a single letter and is easily lost when text is converted to uppercase, typed on a phone or copied from a table. When the letter case is unreliable, use the full name in records and exports. A column called size in MB should be checked at least once against a few real file sizes before it is used for calculations or comparisons.

What one byte and a few bytes can hold

The size of a byte sets the range of values it can store. Eight bits give 2 to the power 8, or 256 combinations, which is 0 to 255 as a number or two hexadecimal digits from 00 to FF. Two bytes, 16 bits, give 65,536 combinations. Four bytes, 32 bits, give 4,294,967,296. These figures explain common limits: a color channel stored in one byte runs from 0 to 255, a port number fits in two bytes and ends at 65,535, and a 32-bit address space holds a little over four billion values. Counting bits is the natural way to reason about such ranges, while counting bytes is the natural way to talk about how much space a record or file occupies.

Where each unit is normally used

Storage capacity and file sizes are normally given in bytes: a memory card is sold in gigabytes, and an operating system lists a document in kilobytes. Network and communication speeds are traditionally given in bits per second: a broadband plan advertises megabits per second. Seeing a mix of both in one comparison is where mistakes happen, such as dividing a file size in megabytes by a link speed in megabits and getting an answer that is eight times too small. The unit of the quantity tells you which family you are in. Convert both sides into the same unit before comparing or dividing, and write the unit with every figure.

Prefixes add a second source of error

Bits and bytes can both carry decimal prefixes (kilo, mega, giga, meaning powers of 1,000) or binary prefixes (kibi, mebi, gibi, meaning powers of 1,024). The factor of eight between bits and bytes is separate from the prefix factor. A mebibyte, 1,048,576 bytes, contains 8,388,608 bits, and a decimal megabyte contains 8,000,000 bits. If both the unit and the prefix families are different between two records, convert in two steps and check each one. The page on decimal and binary storage labels covers the prefix side, while this one covers the eight-to-one relation between the base units themselves.

Quantity versus rate

A count of bits or bytes is a quantity. A label such as bits per second or megabytes per second describes a rate, which needs a time to become a quantity. Transferring 800 bits is a different statement from transferring at 800 bits per second, which would move 100 bytes in each second. Keep the denominator in headers and exports: a column named speed with entries such as 100 Mbps is clear, but a column named size with entries such as 100 Mb could be a quantity of megabits or a typing error for megabytes. If a rate is meant, the time unit has to travel with the number so that no one treats it as a total.

A sanity check before using a converted count

Before relying on a converted count, check it against a familiar size. A plain text line of 80 ASCII characters occupies 80 bytes and 640 bits. A short email of 2 kilobytes holds about 16,000 bits. A one-minute audio clip at 128 kilobits per second is 7,680 kilobits, which is 960 kilobytes. If a result is eight times too large or too small compared with a figure you can estimate, the bit and byte labels are usually the cause. Comparing the order of magnitude costs a few seconds and is more reliable than rereading the digits of a long number for typos.

What the converter covers

The data size converter changes the unit used to express a quantity of data. It does not measure files, check storage overhead or predict what a device will report. File systems reserve space for metadata, drives are sold with decimal prefixes while some operating systems display binary ones, and compressed or sparse files may have a stored size that differs from their logical size. The conversion is exact arithmetic on the number you provide, so the quality of the output depends on whether the input and its unit label were correct in the first place. Verify the label from the source record before trusting the result.

Reproduce the checks

Bit quantity to bytes

Open the Data size converter and enter:

Value
800
From
bit
To
byte

Expected output:

Converted value

100

Convert the stated bit quantity to byte before using it in the comparison.

Byte quantity to bits

Open the Data size converter and enter:

Value
800
From
byte
To
bit

Expected output:

Converted value

6400

Convert the stated byte quantity to bit before using it in the comparison.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks