Skip to content
ENExplore Calculators

File Size Calculator

Convert file sizes between bytes, KB, MB, GB and TB with binary or decimal units.

About File Size Calculator

Linux tools disagree on whether a 'kilobyte' means 1000 or 1024 bytes. Binary units (KiB, MiB, GiB — powers of 1024) are what the kernel, /proc/meminfo, free and most du -h output actually use, even when they print the label 'K', 'M' or 'G'. Decimal units (KB, MB, GB — powers of 1000) are what disk manufacturers print on packaging and what tools like df sometimes use with --si. This calculator converts between any two size units using either base so you can reconcile 'df says 1.8T but the drive box says 2TB'.

Formula

Binary conversion

bytes = value × 1024^n, where n = 0 for B, 1 for KB, 2 for MB, 3 for GB, 4 for TB

v
input value
n
unit power (0=B, 1=KB, 2=MB...)

Worked example

With the default values below, File Size Calculator returns Converted Value of 1,024.000000. Change any input above and every figure here is recalculated in your browser.

Inputs used

Valueminimum 0
1
From Unitone of Bytes (B), Kilobytes (KB), Megabytes (MB), Gigabytes (GB), Terabytes (TB)
Gigabytes (GB)
To Unitone of Bytes (B), Kilobytes (KB), Megabytes (MB), Gigabytes (GB), Terabytes (TB)
Megabytes (MB)
Unit Baseone of Binary (1024-based, KiB/MiB/GiB), Decimal (1000-based, KB/MB/GB)
Binary (1024-based, KiB/MiB/GiB)

Results

Converted Value
1,024.000000
Conversion
1 GB = 1024 MB
Total Bytes
1,073,741,824
Binary (1024-based) Equivalent
1.00 GiB
Decimal (1000-based) Equivalent
1.07 GB

Step by step

  1. 1Values used
  2. 2Binary conversion
  3. 3Converted Value= 1,024.000000
  4. 4Conversion= 1 GB = 1024 MB
  5. 5Total Bytes= 1,073,741,824
  6. 6Binary (1024-based) Equivalent= 1.00 GiB
  7. 7Decimal (1000-based) Equivalent= 1.07 GB

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why does my 1TB drive show as 931GB in Linux?

Drive manufacturers use decimal TB (1,000,000,000,000 bytes). Linux tools like df typically report binary GiB (1024-based) but label it 'G'. 1,000,000,000,000 bytes ÷ 1024³ ≈ 931 GiB, which is why the same drive appears smaller in the OS.

What is the difference between KB and KiB?

KB (kilobyte) technically means 1000 bytes under SI standards, while KiB (kibibyte) unambiguously means 1024 bytes. In practice most Linux tools use 1024-based math but print 'KB' or 'K' as the label, which is the main source of confusion this calculator resolves.

Which base should I use for RAM sizes?

Always binary (1024-based). RAM is physically organized in powers of 2, and /proc/meminfo, free -h and top all report memory using 1024-based KiB/MiB/GiB even when labeled K/M/G.

File Size Calculator | Calcrivo