Byte / Bit Converter
Convert between bits, bytes, KB, MB, GB, TB and PB.
Reviewed by Aygul Dovletova · Last reviewed
Using the Byte / Bit Converter
- Type a non-negative number into the input. Scientific notation (
1e6) is accepted. - Pick the input unit by clicking b (bits), B (bytes), KB, MB, GB, TB or PB.
- Toggle the base between Binary (powers of 1024 - IEC KiB, MiB, GiB family) and Decimal (powers of 1000 - SI K, M, G prefixes). The base toggle controls how every row is rendered from the shared bit-total.
- Read all rows at once in the grid. Every unit reflects the same underlying bit count, translated through either the IEC or the SI prefix table.
- Click Copy on any row to place that number on your clipboard.
What This Tool Is For (vs the Data Storage Converter)
This page is focused on the bits-vs-bytes axis and on the formal distinction between IEC binary prefixes (kibibyte, mebibyte, gibibyte = KiB, MiB, GiB - powers of 1024) and SI decimal prefixes (kilobyte, megabyte, gigabyte = KB, MB, GB - powers of 1000). The adjacent data-storage converter dwells on the consumer-device story - why a drive shows less than advertised. Internally, the value you type is normalized to a bit count (a JavaScript Number - we fall back to BigInt only on explicit overflow). All seven rows then recompute from that single source of truth. The component is a Preact island: no fetch, no server round-trip for the conversion itself, just an onInput handler that multiplies and divides the bit total by the selected prefix factor.
Where You Meet Bits vs Bytes
- Network speed - your ISP sells in megabits per second; your browser shows download speed in megabytes per second (divide by 8).
- Storage - files and RAM are measured in bytes; only CPU register widths and rare low-level specs use bits.
- Encryption key sizes - AES-256 means 256 bits = 32 bytes of key material.
- Display color depth - 24-bit RGB means 3 bytes per pixel; 32-bit means 4 bytes (with an alpha channel).
- Video bitrates - Mbps (megabits per second) is the cinematographer\'s unit; divide by 8 to estimate storage per second.
- Password and token entropy - quoted in bits of randomness (a 128-bit UUID equals 16 bytes, roughly 3.4e38 possible values).
Pitfalls
Three common mistakes. First: bits and bytes at the same prefix look identical in headlines. "100 Mbps" is 100 megabits per second; "100 MB/s" is 100 megabytes per second - eight times larger. Always check the case and the "b" / "B". Second: software uses "KB" for both 1000 and 1024 bytes. Windows Explorer says "KB" but means KiB. Linux tools mostly say "KiB" or "MiB" and mean binary explicitly. JEDEC memory specs say "KB" but mean KiB (historical). IEC 60027-2 (1998) is the standard that disambiguates: use KiB / MiB / GiB / TiB / PiB for 1024-based, and K / M / G / T / P for 1000-based. Third: JavaScript\'s Number loses integer precision above 2^53. The converter switches to BigInt for extreme magnitudes (petabytes and beyond), but the displayed number may still show trailing zeros from the decimal formatter.
IEC 60027-2 in 60 Seconds
Before 1998, "kilobyte" meant either 1000 or 1024 bytes depending on context - nobody in the industry cared because everybody was a programmer. As consumer computing grew, the ambiguity became the root of the "my 1 TB drive only has 931 GB" complaint. IEC 60027-2 (1998, updated 2005) defined the binary prefixes kibi- (Ki, 2^10), mebi- (Mi, 2^20), gibi- (Gi, 2^30), tebi- (Ti, 2^40), pebi- (Pi, 2^50), exbi- (Ei, 2^60), zebi- (Zi) and yobi- (Yi). ISO/IEC 80000-13:2008 and IEEE 1541-2002 reaffirmed them. Adoption is partial: Linux ls -lh, du -h, and macOS diskutil tend to use the IEC prefixes; Windows Explorer does not. This tool presents both so you can see at a glance what either interpretation gives.
Alternatives
For quick math, node -e "console.log(1024 ** 4)" or a Python REPL is as fast as this tool. Linux admins live in dd, ls -lh, du -h, free -h which mostly output KiB/MiB/GiB. numfmt (part of GNU coreutils) converts between human-readable and raw-byte counts on the command line: numfmt --from=iec 2G. For file-size planning (how many photos fit in 64 GB), most cameras and phones ship their own "photos remaining" estimator that accounts for compression behavior the converter cannot know. This page is the right choice when you want every unit visible with both bases side by side in one URL.
Frequently Asked Questions
How many bits are in a byte?
Eight, by modern convention. The byte was not always eight bits - early computers used 6, 7 or 9 bit "bytes". The 8-bit byte became standard with the IBM System/360 in 1964, was ratified in ISO/IEC 2382-1, and is now formalized as the "octet" in networking standards where the term "byte" is sometimes ambiguous. Every modern CPU, file format and network protocol assumes 8 bits per byte.
What is the difference between KB and KiB?
KB, in the SI sense, equals exactly 1000 bytes. KiB, the IEC binary prefix kibibyte, equals exactly 1024 bytes. They differ by about 2.4%. The distinction was codified in IEC 60027-2 in 1998 to eliminate the ambiguity of "KB" meaning either 1000 or 1024 depending on context. Similar pairs exist for all larger units: MB / MiB, GB / GiB, TB / TiB, PB / PiB.
Is my input sent to a server?
No. The conversion runs inside a Preact component using plain JavaScript arithmetic and - at very high magnitudes - BigInt for precision. There is no fetch call, no websocket, no telemetry on your input values. PostHog logs the pageview but not the numbers you type. You can turn off networking after the page loads and the converter keeps working.
Why do networking speeds use bits per second?
The electrical signaling on a wire or radio link transfers one bit at a time. Measuring in bits per second matches the physical reality of how fast symbols can be modulated onto the medium. A 1 Gbps Ethernet link moves 10^9 bits per second = 125,000,000 bytes per second = 125 MB/s. Dividing by 8 is the standard first step when comparing ISP speeds against file-download predictions.
How many bytes are in a typical AES-256 key?
32 bytes exactly. AES-256 uses a 256-bit key (256 / 8 = 32 bytes). AES-128 uses 16 bytes; AES-192 uses 24 bytes. An AES block is always 128 bits (16 bytes) regardless of key size. The initialization vector for AES-GCM is 12 bytes, and the authentication tag is usually 16 bytes. All those numbers are specified in FIPS 197 and NIST SP 800-38D.
Why is JavaScript Number imprecise above 2^53?
JavaScript's Number type is an IEEE 754 double-precision float, which uses a 52-bit mantissa plus an implicit leading bit. That gives exact integer representation up to 2^53 - 1 (Number.MAX_SAFE_INTEGER = 9,007,199,254,740,991). Above that, consecutive integers start aliasing - 2^53 and 2^53 + 1 both map to the same bit pattern. For byte counts in the exabyte range, use BigInt or string-based arithmetic. The converter switches to BigInt internally past the safe range.
What is a nibble?
Half a byte - four bits. A single hexadecimal digit (0-F) holds exactly one nibble of information, which is why hex dumps pair up nicely with byte layouts. The term is informal rather than standards-track and rarely appears in modern technical writing; you still see it in retro-computing and low-level networking contexts. This converter does not list nibbles as a unit, but you can enter "0.5 B" if you ever need it.
How many bits does a single pixel use?
Depends on the format. 8-bit grayscale uses 1 byte per pixel. 24-bit RGB (the usual sRGB image) uses 3 bytes. 32-bit RGBA adds an alpha channel for 4 bytes. HDR and scientific imaging use 10, 12 or 16 bits per channel, giving 30, 36 or 48 bits per pixel. A 4K (3840 x 2160) 24-bit frame is 3840 * 2160 * 3 = 24,883,200 bytes = 23.7 MiB uncompressed.
What comes after petabyte?
Exabyte (EB / EiB = 10^18 or 2^60 bytes), zettabyte (ZB / ZiB = 10^21 or 2^70), yottabyte (YB / YiB = 10^24 or 2^80). In 2022 the General Conference on Weights and Measures added ronna (10^27) and quetta (10^30) as the new SI super-large prefixes, with ronto and quecto as their submultiples. Global IP traffic crossed the zettabyte-per-year mark around 2016 according to Cisco VNI reports. This tool stops at petabyte because consumer-scale use cases rarely exceed it.
How do I compute how long a download takes?
File size in bits, divided by link speed in bits per second, gives time in seconds. A 5 GB file (in binary, 5 * 2^30 bytes = 42,949,672,960 bits) over a 100 Mbps link takes 42,949,672,960 / 100,000,000 = 429.5 seconds, or about 7 minutes 10 seconds in theory. Real downloads are 10-30% slower because of TCP slow-start, TLS handshakes and server-side throttling. Use this converter to move between units before plugging into the division.
Is this just a b to KB to MB to GB conversion or does it cover bits too?
It covers both. Each row in the grid is one of b (bits), B (bytes), KB, MB, GB, TB, and PB. Type a value into any row and the rest of the grid - including the b-to-KB-to-MB-to-GB ladder and the bit / byte split - recomputes from a single internal bit total. The base toggle then re-renders every cell as binary (1024-based) or decimal (1000-based), which is the part most other "byte converter" or "bytes calculator converter" pages skip.
Why a single online encoding converter for bytes instead of a separate KB-to-MB calculator?
Splitting the conversion across narrow tools (KB to MB, then MB to GB) costs more keystrokes and risks rounding error at each step. Holding every unit in one row, recomputed from a shared bit total, eliminates the rounding chain and lets you read the answer for any unit instantly. The same panel doubles as the data size converter and the bit-rate sanity-check tool, which is why the page is structured as a multi-row grid rather than a single input-output pair.
More Math & Calculators
Age Calculator
Calculate exact age in years, months and days from a birthdate.
Open toolArea & Volume Calculator
Calculate area of 2D shapes and volume of 3D solids.
Open toolBMI Calculator
Calculate your Body Mass Index and find your weight category.
Open toolDiscount Calculator
Calculate discount amount, sale price, savings, and discounted value with optional sales tax. Supports stacked coupons.
Open toolFibonacci Sequence Generator
Generate Fibonacci numbers up to any length.
Open toolFraction Calculator
Add, subtract, multiply and divide fractions with simplified results.
Open tool