Data Storage Converter Formula

Understand the math behind the data storage converter. Each variable explained with a worked example.

Formulas Used

Kilobytes

kb = value / 1024

Megabytes

mb = value / pow(1024, 2)

Gigabytes

gb = value / pow(1024, 3)

Terabytes

tb = value / pow(1024, 4)

Bits

bits = value * 8

Variables

VariableDescriptionDefault
valueData Size(bytes)1073741824

How It Works

Data Storage Converter

Conversion Factors from Bytes (Binary)

  • Kilobytes: bytes / 1,024
  • Megabytes: bytes / 1,048,576
  • Gigabytes: bytes / 1,073,741,824
  • Terabytes: bytes / 1,099,511,627,776
  • Bits: bytes × 8
  • Note: This converter uses binary (base-2) units where 1 KB = 1,024 bytes.

    Worked Example

    Convert 1,073,741,824 bytes (1 GB) to other units.

    value = 1073741824
    1. 01KB = 1073741824 / 1024 = 1048576 KB
    2. 02MB = 1073741824 / 1048576 = 1024 MB
    3. 03GB = 1073741824 / 1073741824 = 1 GB
    4. 04TB = 1073741824 / 1099511627776 = 0.000976563 TB

    Ready to run the numbers?

    Open Data Storage Converter