Automatic: 1,024 = 1024; 1,5 = 1.5
Precision and interpretation
Local files · 0
File sizes use metadata only. File contents are not read or uploaded.
Up to 1,000 files or batch rows; TXT/CSV up to 512 KiB. Numbers: 256 digits, exponent ±300, 100 expression terms.
Conversion steps
1 B × 8 bit/B
= 8 bit ÷ 8000 bit/kB = 0.001 kB
Automatic: 1,024 = 1024; 1,5 = 1.5
Decimal bytes
Binary bytes
Decimal bits
Binary bits
All computation and conversion run locally in the browser via the V8 engine or WebAssembly. Files and text never leave your device.
About
SI prefixes use powers of 1000; IEC prefixes use powers of 1024. Enter a value, a fraction or a mixed size such as 2 GB 500 MB. Convert keeps exact bit-based fractions internally. Calculate handles storage reserves, transfer efficiency, file counts and dimension-aware arithmetic; Batch processes independent records.
Unit reference
UTF-8 examples: A = 1 B, 中 = 3 B, 😀 = 4 B. Emoji sequences can contain several code points and occupy more bytes.
1 B = 8 bit · 1 Nibble = 4 bit · 1 kB = 1000 B · 1 KiB = 1024 B
SI · Unit reference
| Symbol | Name | Exact bytes | Power / next step |
|---|---|---|---|
| B | byte | 1 | 10^0 · ×1000 |
| kB | kilobyte | 1000 | 10^3 · ×1000 |
| MB | megabyte | 1000000 | 10^6 · ×1000 |
| GB | gigabyte | 1000000000 | 10^9 · ×1000 |
| TB | terabyte | 1000000000000 | 10^12 · ×1000 |
| PB | petabyte | 1000000000000000 | 10^15 · ×1000 |
| EB | exabyte | 1000000000000000000 | 10^18 · ×1000 |
| ZB | zettabyte | 1000000000000000000000 | 10^21 · ×1000 |
| YB | yottabyte | 1000000000000000000000000 | 10^24 · ×1000 |
| RB | ronnabyte | 1000000000000000000000000000 | 10^27 · ×1000 |
| QB | quettabyte | 1000000000000000000000000000000 | 10^30 · ×1000 |
IEC · Unit reference
| Symbol | Name | Exact bytes | Power / next step |
|---|---|---|---|
| B | byte | 1 | 2^0 · ×1024 |
| KiB | kibibyte | 1024 | 2^10 · ×1024 |
| MiB | mebibyte | 1048576 | 2^20 · ×1024 |
| GiB | gibibyte | 1073741824 | 2^30 · ×1024 |
| TiB | tebibyte | 1099511627776 | 2^40 · ×1024 |
| PiB | pebibyte | 1125899906842624 | 2^50 · ×1024 |
| EiB | exbibyte | 1152921504606846976 | 2^60 · ×1024 |
| ZiB | zebibyte | 1180591620717411303424 | 2^70 · ×1024 |
| YiB | yobibyte | 1208925819614629174706176 | 2^80 · ×1024 |
| RiB | robibyte | 1237940039285380274899124224 | 2^90 · ×1024 |
| QiB | quebibyte | 1267650600228229401496703205376 | 2^100 · ×1024 |
Common conversions
| Symbol | Multiplier | Example | Use as input |
|---|---|---|---|
| B → kB | × 0.001 | 1 B = 0.001 kB | |
| B → MB | × 0.000001 | 1 B = 0.000001 MB | |
| B → GB | × 0.000000001 | 1 B = 0.000000001 GB | |
| kB → MB | × 0.001 | 1 kB = 0.001 MB | |
| MB → kB | × 1000 | 1 MB = 1000 kB | |
| MB → GB | × 0.001 | 1 MB = 0.001 GB | |
| GB → MB | × 1000 | 1 GB = 1000 MB | |
| GB → TB | × 0.001 | 1 GB = 0.001 TB | |
| TB → GB | × 1000 | 1 TB = 1000 GB | |
| MiB → MB | × 1.048576 | 1 MiB = 1.048576 MB | |
| GiB → GB | × 1.073741824 | 1 GiB = 1.073741824 GB | |
| GB → GiB | × 0.931322574615478515625 | 1 GB = 0.931322574615478515625 GiB | |
| bit → B | × 0.125 | 1 bit = 0.125 B | |
| B → bit | × 8 | 1 B = 8 bit | |
| Mbit/s → MB/s | × 0.125 | 1 Mbit/s = 0.125 MB/s |
Developer code
Examples print exact fractions or quotient/remainder pairs. Rust uses bounded u128; PHP requires GMP.
JavaScript
const bytes = 9007199254740993n;
const factors = {kB:1000n, MB:1000000n, GB:1000000000n,
KiB:1024n, MiB:1048576n, GiB:1073741824n};
// Exact quotient/remainder is also a human-readable full-precision size.
for (const [unit, factor] of Object.entries(factors)) {
console.log(unit, String(bytes / factor), '+', String(bytes % factor) + '/' + factor);
}
console.log('bits', String(bytes * 8n));
console.log('100 Mbps in MB/s:', '100/8');
console.log('10 GB at 100 Mbps in seconds:', 10n*1000000000n*8n/100000000n);TypeScript
const bytes: bigint = 9007199254740993n;
const factors: Record<string,bigint> = {kB:1000n, MB:1000000n, GB:1000000000n,
KiB:1024n, MiB:1048576n, GiB:1073741824n};
for (const [unit, factor] of Object.entries(factors)) {
console.log(unit, String(bytes/factor) + ' + ' + String(bytes%factor) + '/' + factor);
}
console.log('bits', bytes*8n, '100 Mbps in MB/s', '100/8');
console.log('10 GB / 100 Mbps (s)', 10n*1000000000n*8n/100000000n);Python
from fractions import Fraction
b = 9007199254740993
factors = dict(kB=1000, MB=10**6, GB=10**9, KiB=2**10, MiB=2**20, GiB=2**30)
for unit, factor in factors.items():
print(unit, Fraction(b, factor))
print('bits', b * 8)
print('100 Mbps in MB/s', Fraction(100, 8))
print('10 GB / 100 Mbps (s)', Fraction(10*10**9*8, 100*10**6))Java
import java.math.BigInteger;
class Main {
public static void main(String[] args) {
var b = new BigInteger("9007199254740993");
String[] units = {"kB","MB","GB","KiB","MiB","GiB"};
long[] factors = {1000,1000000,1000000000,1024,1048576,1073741824};
for (int i=0;i<units.length;i++) System.out.println(units[i]+" "+b+"/"+factors[i]);
System.out.println("bits "+b.multiply(BigInteger.valueOf(8)));
System.out.println("100 Mbps -> MB/s: 100/8; 10 GB / 100 Mbps: 800 s");
}
}Kotlin
import java.math.BigInteger
fun main() {
val b = BigInteger("9007199254740993")
val factors = mapOf("kB" to 1000L,"MB" to 1000000L,"GB" to 1000000000L,
"KiB" to 1024L,"MiB" to 1048576L,"GiB" to 1073741824L)
for ((unit,factor) in factors) println("$unit $b/$factor")
println("bits "+b.multiply(BigInteger.valueOf(8)))
println("100 Mbps -> MB/s: 100/8; 10 GB / 100 Mbps: 800 s")
}Go
package main
import ("fmt"; "math/big")
func main() {
b,_ := new(big.Int).SetString("9007199254740993",10)
factors := map[string]int64{"kB":1000,"MB":1000000,"GB":1000000000,"KiB":1024,"MiB":1048576,"GiB":1073741824}
for unit,f := range factors {fmt.Println(unit,new(big.Rat).SetFrac(b,big.NewInt(f)).RatString())}
fmt.Println("bits",new(big.Int).Mul(b,big.NewInt(8)))
fmt.Println("100 Mbps -> MB/s: 100/8; 10 GB / 100 Mbps: 800 s")
}C#
using System;
using System.Numerics;
class Program {
static void Main() {
var b = BigInteger.Parse("9007199254740993");
string[] units={"kB","MB","GB","KiB","MiB","GiB"};
long[] factors={1000,1000000,1000000000,1024,1048576,1073741824};
for(int i=0;i<units.Length;i++) Console.WriteLine(units[i]+" "+b+"/"+factors[i]);
Console.WriteLine("bits "+b*8);
Console.WriteLine("100 Mbps -> MB/s: 100/8; 10 GB / 100 Mbps: 800 s");
}
}PHP
<?php
// Requires the GMP extension for arbitrary-size integer arithmetic.
$b = gmp_init('9007199254740993');
$factors = ['kB'=>1000,'MB'=>1000000,'GB'=>1000000000,'KiB'=>1024,'MiB'=>1048576,'GiB'=>1073741824];
foreach ($factors as $unit=>$factor) echo $unit.' '.gmp_strval($b).'/'.$factor.PHP_EOL;
echo 'bits '.gmp_strval(gmp_mul($b,8)).PHP_EOL;
echo '100 Mbps -> MB/s: 100/8; 10 GB / 100 Mbps: 800 s'.PHP_EOL;Rust
fn main() {
// u128 covers this example. Use a big-integer crate beyond u128::MAX.
let b: u128 = 9007199254740993;
let factors = [("kB",1000),("MB",1000000),("GB",1000000000),("KiB",1024),("MiB",1048576),("GiB",1073741824)];
for (unit,factor) in factors {println!("{} {}/{}",unit,b,factor);}
println!("bits {}",b*8);
println!("100 Mbps -> MB/s: 100/8; 10 GB / 100 Mbps: 800 s");
}Standards and references
How to use
Formats & specifications
FAQ
What are bytes, bits and nibbles?
A bit is a binary digit; one byte is 8 bits and one nibble is 4 bits. A mathematical conversion can produce fractional bytes: 1 bit = 0.125 B. Actual files occupy whole bytes.
Does KB mean 1000 or 1024 bytes?
Standard SI kB means 1000 B; KB is accepted as a common spelling. KiB means 1024 B. The optional Legacy mode interprets SI byte labels with powers of 1024 and shows the actual factors. Bits and IEC units do not change.
How do MB/MiB, GB/GiB and TB/TiB differ?
MB = 10^6 B, MiB = 2^20 B; GB = 10^9 B, GiB = 2^30 B; TB = 10^12 B, TiB = 2^40 B. Thus 1 GB = 1000 MB, 1 GiB = 1024 MiB, 1 MiB = 1.048576 MB and 1 GiB = 1.073741824 GB.
How do I convert bytes to MB or GB to bytes?
Divide bytes by 1,000,000 for MB and by 1,000,000,000 for GB. Multiply GB by 1,000,000,000 for bytes. For MiB and GiB use 1,048,576 and 1,073,741,824 respectively. The reference tables list every exact factor.
Why does a 1 TB drive show about 931 GB?
1 TB = 1,000,000,000,000 B = approximately 931.3226 GiB. Some software labels this binary value GB. Those numbers describe the same bytes, not missing storage. Filesystem overhead and system reservations are separate; this calculator deducts only reserves you supply.
Why are Mbps and MB/s different?
Networks commonly report bits per second. Uppercase B means bytes, lowercase b means bits: 100 Mbps = 12.5 MB/s, and 1 Gbps = 125 MB/s, theoretically. Overhead, congestion, server limits and devices affect actual throughput. No speed test runs here.
How is transfer time calculated?
Time = size in bits ÷ (nominal bits/s × efficiency). A 10 GB file at 100 Mbps takes 800 s = 13 min 20 s at 100%, or 1000 s at 80%. The same equation solves required nominal rate or transferable size. Milliseconds through days are accepted.
How many files fit in a capacity?
Subtract used space and fixed reserve, then divide by average file size and round down. A target count gives exact required bytes and remaining space, including a negative difference if it exceeds capacity. Preset averages are editable; format, resolution and compression change real file sizes.
Can I add and divide sizes with different units?
Yes: 2 GB + 512 MB = 2.512 GB; 256 GB ÷ 8 MB = 32000, a dimensionless ratio. Multiplying a size by a scalar is supported, but size × size is rejected. Named items support integer quantities, subtotals, total, mean per file, extremes and distribution.
How are huge and fractional values kept precise?
Inputs become reduced BigInt numerator/denominator pairs. Even 9007199254740993 B, 1 QB and 1 QiB retain every digit. JavaScript Number is exact only for integers up to 9007199254740991. Display rounding never changes the internal value; exact copy returns a finite decimal or fraction.
Which display and rounding options are available?
Automatic/significant figures, fixed decimals, full exact, scientific and engineering notation are available. Rounding supports half up, half even, floor, ceiling and truncation toward zero. Rounded results carry ≈; a recurring decimal is available as an exact fraction. Grouping and trailing zeros affect display only.
How do localized numbers and ambiguous units work?
Automatic input recognition treats valid comma groups such as 1,024 as 1024, and 1,5 as 1.5. With both comma and point, the last separator is decimal and other groups are validated. A point alone stays decimal. Choose an explicit number format to override an ambiguous value. Full-width digits and nonbreaking spaces are normalized; MB and Mb remain distinct.
What do PB through QB and PiB through QiB mean?
PB, EB, ZB, YB, RB and QB are 10^15, 10^18, 10^21, 10^24, 10^27 and 10^30 bytes. PiB through QiB use 2^50 through 2^100 bytes in steps of ten in the exponent. These are unit definitions, not claims about how much data exists worldwide.
Can I inspect local files and convert batches?
Choose or drop up to 1000 files. File.size supplies exact byte counts without reading contents. Send the metadata to conversion, transfer, file-count, totals or Batch modes. TXT/CSV imports are limited to 512 KiB and 1000 records; quoted fields, BOM, CRLF and Unicode are supported. Errors stay per row; cancel and retry are available.
Are exported values and shared links precise and private?
TXT, CSV and JSON exports contain exact strings. CSV prefixes dangerous formula fields with an apostrophe. Share copies a validated single-conversion fragment only after your click; file names and imported batches are excluded. Only unit favorites and display preferences are stored. Calculations and file metadata are not uploaded.
Which units should I use for files, memory, disks and APIs?
Store integer bytes in APIs, databases, logs and quotas, then format for display. Disks commonly use decimal labels, memory often binary quantities and network rates bits/s, but product documentation decides. File size counts encoded bytes, not characters: UTF-8 characters can take multiple bytes. Never recover exact storage from a rounded MB display string.
Why does Base64 make data larger?
Standard padded Base64 uses 4 × ceil(bytes/3) characters, usually about one third more than the original bytes. Prefixes add overhead. Use the related Base64 tool for encoding and decoding; this page only calculates sizes.
Limitations
- 256 digits per number; exponent ±300; expressions up to 4096 characters, 100 terms and 20 parenthesis levels. Batches and files up to 1000 entries, imported TXT/CSV up to 512 KiB. Estimates do not measure device or network performance.