Bytes to Kilobytes

Convert bytes to kilobytes for web performance, file sizing, and data transfer. Covers both decimal KB (÷1,000) and binary KiB (÷1,024) with web and file context.

Enter your values above to see the results.

Tips & Notes

  • Two different kilobytes exist: decimal KB = 1,000 bytes (SI standard, IEC 80000-13, used by hard drives, SSDs, and internet speeds). Binary KiB = 1,024 bytes (used by operating systems, RAM, and traditional computing contexts).
  • Web performance context: a typical plain HTML page is 15-50 KB; a web page with images averages 2,000+ KB (2 MB). Google recommends keeping total page weight under 1,600 KB for a good Lighthouse performance score.
  • Email: a plain text email is typically 2-10 KB. A formatted HTML email with no images: 20-80 KB. An email with a 500 KB attached PDF: 500+ KB total. SMTP server limits vary: most allow up to 10-25 MB per email.
  • HTTP headers: a typical HTTP request has 300-500 bytes of headers; HTTPS adds TLS overhead. Browser developer tools (Network tab) show exact byte sizes for each resource. Use bytes for sub-kilobyte precision.
  • Source code files: a JavaScript library like jQuery minified is approximately 86,000 bytes = 86 KB (decimal). React minified: ~130,000 bytes = 130 KB. A typical website stylesheet (CSS): 10-50 KB. Python script (100 lines): 3-5 KB.

Common Mistakes

  • Assuming KB always means 1,024 bytes — operating systems (Windows, Linux, macOS) historically used 1 KB = 1,024 bytes. The IEC introduced KiB (kibibyte) for 1,024 bytes in 1998 to distinguish from decimal KB (1,000 bytes). Today, consumer drives use decimal; OS memory reporting uses binary.
  • Confusing kilobytes (KB) with kilobits (kb or Kbit) — internet speeds are measured in kilobits per second (Kbps or kb/s). 1 KB = 8 Kbits. A 100 Kbps connection downloads 100/8 = 12.5 KB per second. The lowercase b indicates bits; uppercase B indicates bytes.
  • Applying internet speed units (Kbps) directly to file sizes (KB) — to find download time: time (s) = file size (KB × 8) / speed (Kbps). A 500 KB file on a 1,000 Kbps (1 Mbps) connection: time = (500 × 8) / 1,000 = 4 seconds.
  • Ignoring compression — a 50 KB HTML file compressed with gzip is typically 10-15 KB over the wire. Web servers and CDNs compress text-based content automatically. Browser developer tools show both compressed (transferred) and uncompressed size.
  • Treating byte size as storage requirement — a 50 KB text file on a Windows NTFS filesystem may actually occupy 64 KB of disk space due to cluster allocation (default 4,096-byte clusters, rounded up). Small files waste proportionally more space.

Bytes to Kilobytes Overview

The byte is the fundamental unit of digital storage — every file, database record, and network packet is measured in bytes. The kilobyte (KB) is the first practical scale above individual bytes, covering text files, web pages, and small documents.

Bytes to kilobytes formula:

KB (decimal) = B / 1,000 | KiB (binary) = B / 1,024 | Difference: 1,024 B = 1.024 KB or 1.000 KiB
EX: Web page HTML file 18,500 bytes → 18.5 KB (decimal) = 18.066 KiB (binary). Email attachment 750 bytes → 0.75 KB (decimal) = 0.732 KiB (binary)
Inverse — kilobytes to bytes:
B = KB × 1,000 | B = KiB × 1,024
EX: 5 KB limit for upload → 5 × 1,000 = 5,000 bytes maximum. OS reports file as 5 KiB → 5 × 1,024 = 5,120 bytes actual size
Common byte-scale file sizes:
File TypeTypical Size (bytes)Decimal KBBinary KiB
Empty text file0 bytes0 KB0 KiB
Plain text (1 page)2,000-5,000 B2-5 KB1.95-4.88 KiB
Cookie (web)100-4,000 B0.1-4 KB0.10-3.91 KiB
HTML page (no images)15,000-50,000 B15-50 KB14.6-48.8 KiB
CSS stylesheet10,000-80,000 B10-80 KB9.77-78.1 KiB
JavaScript (minified)50,000-300,000 B50-300 KB48.8-293 KiB
Decimal vs. binary — the size gap grows with scale:
Decimal UnitBytesBinary UnitBytesGap
1 KB1,0001 KiB1,0242.4%
1 MB1,000,0001 MiB1,048,5764.9%
1 GB1,000,000,0001 GiB1,073,741,8247.4%
1 TB1,000,000,000,0001 TiB1,099,511,627,7769.9%
1 PB10¹⁵1 PiB2⁵⁰12.6%
The decimal vs. binary distinction creates the "missing gigabytes" phenomenon: a drive labeled "1 TB" (1,000,000,000,000 bytes) shows as 931.3 GiB (≈931 GB) in Windows, which reports in binary units. The bytes are all there — the difference is purely in how 1,000 vs. 1,024 is applied at each prefix step. Understanding which convention applies is essential for any precise file size or storage capacity calculation.

Frequently Asked Questions

Divide bytes by 1,000 for decimal KB (storage, internet) or by 1,024 for binary KiB (OS reporting). Examples: 500 bytes = 0.5 KB (decimal) = 0.488 KiB (binary). 2,000 bytes = 2 KB (decimal) = 1.953 KiB (binary). 5,500 bytes = 5.5 KB (decimal) = 5.371 KiB (binary). 10,000 bytes = 10 KB (decimal) = 9.766 KiB (binary). Most practical contexts (web, storage) use the decimal definition.

Historically, "kilobyte" meant 1,024 bytes in computing (because 2¹⁰ = 1,024 is a convenient binary number). Storage manufacturers adopted the decimal 1,000-byte kilobyte to make drive capacities sound larger. The IEC (International Electrotechnical Commission) standardized in 1998: KB = 1,000 bytes (decimal), KiB = 1,024 bytes (binary kibibyte). Today: hard drives and SSDs use decimal KB; operating systems report RAM and file sizes in binary KiB (often still labeled "KB" in Windows). This causes the apparent size discrepancy when a "1 TB" drive shows as 931 GB in Windows.

Common file sizes: plain text file (1 page) ≈ 3,000-5,000 bytes = 3-5 KB; Microsoft Word document (1 page) ≈ 25,000-100,000 bytes = 25-100 KB; PDF (text only) ≈ 50,000-200,000 bytes = 50-200 KB; Excel spreadsheet (100 rows) ≈ 15,000-50,000 bytes = 15-50 KB; HTML web page (no images) ≈ 15,000-50,000 bytes = 15-50 KB; JavaScript library (minified) ≈ 50,000-200,000 bytes = 50-200 KB. Anything under 1,000 bytes (< 1 KB) is typically a configuration file, log entry, or metadata.

Web performance is directly tied to byte count. Google Core Web Vitals tracks page load speed, which depends on total bytes transferred. Key thresholds: HTML document under 14,000 bytes = fits in first TCP packet (no round-trip needed for initial render); CSS under 50,000 bytes = good; JavaScript under 200,000 bytes per bundle = acceptable; total page weight under 1,600,000 bytes (1,600 KB) = good mobile performance. Every extra kilobyte adds latency, especially on mobile connections. Tools like Lighthouse, PageSpeed Insights, and WebPageTest measure and report byte counts for each resource.

Text encoding affects how many bytes each character requires. ASCII: 1 byte per character (covers English alphabet, digits, basic punctuation). UTF-8 (most common on the web): 1 byte for ASCII characters (0-127); 2 bytes for Latin extended, Greek, Arabic, Hebrew; 3 bytes for Chinese, Japanese, Korean (CJK); 4 bytes for emoji and supplementary characters. A 1,000-character English text = approximately 1,000 bytes = 1 KB. The same 1,000 Chinese characters = approximately 3,000 bytes = 3 KB. HTML, JSON, CSS, and XML files are UTF-8 encoded text — their byte size scales with content length and character encoding.

A byte contains exactly 8 bits. A bit is the smallest unit of digital information — either 0 or 1 (binary). Below a byte: 1 nibble = 4 bits = half a byte (used in hexadecimal notation, where each hex digit represents one nibble). 1 byte = 8 bits = 2 nibbles. A byte can represent 2⁸ = 256 distinct values (0-255). Above a byte: kilobyte (1,000 or 1,024 bytes), megabyte, gigabyte, etc. A single ASCII character is 1 byte; an RGB pixel requires 3 bytes (one per color channel); a 32-bit integer uses 4 bytes; a 64-bit floating point number uses 8 bytes.