How Do Bits, Bytes, Megabytes, Megabits, and Gigabits Differ?

What They Mean and How to Convert Between Bits and Bytes

Connecting Through Technology
Koron / Getty Images

The terms bits and bytes in computer networking refer to standard units of digital data transmitted over network connections. There are 8 bits for every 1 byte.

The "mega" prefix in megabit (Mb) and megabyte (MB) are often the preferred way to express data transfer rates because it's dealing mostly with bits and bytes in the thousands. For example, your home network might be able to download data at 1 million bytes every second, which is more appropriately written as 8 megabits per second, or even 8 Mb/s.

Some measurements yield bits to massive values like 1,073,741,824, which is how many bits are in a single gigabyte (which is 1,024 megabytes). What's more is that terabytes, petabyte, and exabytes are even larger than megabytes!

How Bits and Bytes Are Created

Computers use bits (short for binary digits) to represent information in digital form. A computer bit is a binary value. When represented as a number, bits can have a value of either 1 (one) or 0 (zero).

Modern computers generate bits from higher and lower electric voltages running through the device's circuits. Computer network adapters convert these voltages into the ones and zeros needed to physically transmit bits across the network link, a process sometimes called encoding.

Methods of network message encoding vary depending on the transmission medium:

  • Ethernet connections carry bits using electric signals of varying voltages
  • Wi-Fi carries bits using radio signals of varying frequencies
  • Fiber connections use pulses of light to carry bits

A byte is simply a fixed-length sequence of bits. Modern computers organize data into bytes to increase the data processing efficiency of network equipment, disks, and memory.

Examples of Bits and Bytes in Computer Networking

Even casual users of computer networks will encounter bits and bytes in normal situations.

Consider these examples.

IP addresses in Internet Protocol version 4 (IPv4) networking consist of 32 bits (4 bytes). The address, for instance, has values 192, 168, 0 and 1 for each of its bytes. The bits and bytes of that address are encoded like so:

11000000 10101000 00000000 00000001

The rate at which data travels through a computer network connection is traditionally measured in units of bits per second (bps). Modern networks are capable of transmitting millions or billions of bits per second, called megabits per second (Mbps) and gigabits per second (Gbps), respectively.

  • Gigabit Ethernet connections are rated for 1 Gbps
  • Wireless broadband routers offer different connection speed ratings depending on the form of Wi-Fi used. Common rates supported by routers include 54 Mbps,150 Mbps, and 600 Mbps

So, if you're downloading a 10 MB (80 Mb) file on a network that can download data at 54 Mbps (6.75 MBs), you can use the conversion information below to find that the file can be downloaded in just over a second (80/54=1.48 or 10/6.75=1.48).

Tip: You can see how fast your network can download and upload data with an internet speed test site.

In contrast, computer storage devices like USB sticks and hard drives transfer data in units of bytes per second (Bps).

It's easy to confuse the two but bytes per second is Bps, with a capital "B," while bits per second uses a lowercase "b."

Wireless security keys like those for WPA2, WPA, and the old WEP are sequences of letters and numbers usually written in hexadecimal notation. Hexadecimal numbering represents each group of four bits as one value, either a number between zero and nine, or a letter between "A" and "F."

WPA keys look like this:

12345678 9ABCDEF1 23456789 AB

IPv6 network addresses also commonly utilize hexadecimal numbering. Each IPv6 address contains 128 bits (16 bytes), like:


How to Convert Bits and Bytes

It's really easy to manually convert bit and byte values when you know the following:

  • 8 bits = 1 byte
  • 1,024 bytes = 1 kilobyte
  • 1,024 kilobytes = 1 megabyte
  • 1,024 megabytes = 1 gigabyte
  • 1,024 gigabytes = 1 terabyte

As an example, to convert 5 kilobytes into bits, you'd use the second conversion to get 5,120 bytes (1,024 X 5) and then the first to get 40,960 bits (5,120 X 8).

A much easier way to get these conversions is to use a calculator like a Bit Calculator. You can also estimate the values by entering the question into Google.