CINXE.COM
Convert between Bytes, KB, MB, GB, TB and KiB, MiB, GiB, TiB - SS64.com
<!doctype html><html lang="en"> <head><meta charset="UTF-8"> <meta name="Description" CONTENT="A simple online conversion page which can quickly convert values between Bytes,KB,MB,GB,TB and also between Bits KiB,MiB,GiB and TiB"> <meta name="viewport" content="width=1000, initial-scale=1"> <link rel="stylesheet" href="main.css" type="text/css"> <link rel="icon" href="/favicon.ico" sizes="48x48"> <link rel="icon" href="/favicon.svg" sizes="any" type="image/svg+xml"> <title>Convert between Bytes, KB, MB, GB, TB and KiB, MiB, GiB, TiB - SS64.com</title> <style> table{border-collapse: separate;margin-left: 0;} td{padding: 0;} .tblhead{ text-align: center; padding-top: 15px;} .raised {padding-left:1px; color:windowtext; font-weight:400; text-decoration:none; vertical-align:bottom; border:none; padding-top: 1px; padding-right: 1px;} .smallnotes {font-size: smaller} .in, .cleo{ border-top: 1px solid #7C7C7C; border-left: 1px solid #ACB5BE; border-right: 1px solid #ACB5BE; border-bottom: 1.5px solid #ACB5BE; border-radius: 6px; box-shadow: inset #ccc 0px 1px 0px; height: 20px; padding: 6px; } .cleo{ height: 20px; font-family: Menlo, "Bitstream Vera Sans", "Courier New", courier, monospace; } .in:focus, .cleo:focus, #q:focus{ outline: none; border-bottom: 1.5px solid #4D90FE; transition: box-shadow 5s linear; /* box-shadow: 0px 0px 4px 0px #4D90FE; */ } .btn1 { width: 140px; height: 35px; border: 1px solid #889; border-radius: 4px; color: var(--btn-link); /* blue hyperlink #0A22D0*/ cursor: pointer; text-align: center; /*background-image: linear-gradient(to bottom, #D7D7E4, #C3C3CE);*/ background-color: var(--btn-col); transition: background-color 0.25s, color 0.25s; padding-bottom:3px; -webkit-appearance: none; } /* Link - Visited - Hover - Focus - Active */ .btn1:focus{border: 1px solid #4B8DF8; outline: none;color: #229231;} .btn1:hover { /* background-image: linear-gradient(to bottom, #1188EA, #1188EA);*/ background-color: #1DB954; color: var(--txt-dark); transition: background-color 0.25s, color 0.25s; } .btn1:active{ color: #1676F1; border: 1px solid #385686; background-color:#01AF3F; outline: none; transition: background-color 0.25s; } tr:nth-child(even) td{ /* lighten alt rows DEDEE4 D1D1D8*/ background-color: inherit; } </style> <script> function convert1(f) { f.byte2.value=f.byte.value f.kib.value=Math.round(f.byte.value/1024*100000)/100000 f.mib.value=Math.round(f.byte.value/1048576*100000)/100000 f.gib.value=Math.round(f.byte.value/1073741824*100000)/100000 f.tib.value=Math.round(f.byte.value/1099511627776*100000)/100000 f.kb.value=Math.round(f.byte.value/1000*100000)/100000 f.mb.value=Math.round(f.byte.value/1000000*100000)/100000 f.gb.value=Math.round(f.byte.value/1000000000*100000)/100000 f.tb.value=Math.round(f.byte.value/1000000000000*100000)/100000 } function convert2(f) { f.byte.value=f.byte2.value f.kib.value=Math.round(f.byte2.value/1024*100000)/100000 f.mib.value=Math.round(f.byte2.value/1048576*100000)/100000 f.gib.value=Math.round(f.byte2.value/1073741824*100000)/100000 f.tib.value=Math.round(f.byte2.value/1099511627776*100000)/100000 f.kb.value=Math.round(f.byte2.value/1000*100000)/100000 f.mb.value=Math.round(f.byte2.value/1000000*100000)/100000 f.gb.value=Math.round(f.byte2.value/1000000000*100000)/100000 f.tb.value=Math.round(f.byte2.value/1000000000000*100000)/100000 } function convertkib(f) { f.byte.value=Math.round(f.kib.value*1024*100000)/100000 f.byte2.value=Math.round(f.kib.value*1024*100000)/100000 f.mib.value=Math.round(f.kib.value/1024*100000)/100000 f.gib.value=Math.round(f.kib.value/1048576*100000)/100000 f.tib.value=Math.round(f.kib.value/1073741824*100000)/100000 f.kb.value=Math.round(f.byte2.value/1000*100000)/100000 f.mb.value=Math.round(f.kb.value/1000*100000)/100000 f.gb.value=Math.round(f.kb.value/1000000*100000)/100000 f.tb.value=Math.round(f.kb.value/1000000000*100000)/100000 } function convertkb(f) { f.byte.value=Math.round(f.kb.value*1000*100000)/100000 f.byte2.value=Math.round(f.kb.value*1000*100000)/100000 f.mb.value=Math.round(f.kb.value/1000*100000)/100000 f.gb.value=Math.round(f.kb.value/1000000*100000)/100000 f.tb.value=Math.round(f.kb.value/1000000000*100000)/100000 f.kib.value=Math.round(f.byte2.value/1024*100000)/100000 f.mib.value=Math.round(f.byte2.value/1048576*100000)/100000 f.gib.value=Math.round(f.mib.value/1024*100000)/100000 f.tib.value=Math.round(f.mib.value/1048576*100000)/100000 } function convertmib(f) { f.byte.value=Math.round(f.mib.value*1048576*100000)/100000 f.byte2.value=Math.round(f.mib.value*1048576*100000)/100000 f.kib.value=Math.round(f.mib.value*1024*100000)/100000 f.gib.value=Math.round(f.mib.value/1024*100000)/100000 f.tib.value=Math.round(f.mib.value/1048576*100000)/100000 f.mb.value=Math.round(f.byte2.value/1000000*100000)/100000 f.kb.value=Math.round(f.mb.value*1000*100000)/100000 f.gb.value=Math.round(f.mb.value/1000*100000)/100000 f.tb.value=Math.round(f.mb.value/1000000*100000)/100000 } function convertmb(f) { f.byte.value=Math.round(f.mb.value*1000000*100000)/100000 f.byte2.value=Math.round(f.mb.value*1000000*100000)/100000 f.kb.value=Math.round(f.mb.value*1000*100000)/100000 f.gb.value=Math.round(f.mb.value/1000*100000)/100000 f.tb.value=Math.round(f.mb.value/1000000*100000)/100000 f.kib.value=Math.round(f.byte2.value/1024*100000)/100000 f.mib.value=Math.round(f.byte2.value/1048576*100000)/100000 f.gib.value=Math.round(f.mib.value/1024*100000)/100000 f.tib.value=Math.round(f.mib.value/1048576*100000)/100000 } function convertgib(f) { f.byte.value=Math.round(f.gib.value*1073741824*100000)/100000 f.byte2.value=Math.round(f.gib.value*1073741824*100000)/100000 f.kib.value=Math.round(f.byte2.value/1024*100000)/100000 f.mib.value=Math.round(f.byte2.value/1048576*100000)/100000 f.tib.value=Math.round(f.mib.value/1048576*100000)/100000 f.kb.value=Math.round(f.byte2.value/1000*100000)/100000 f.mb.value=Math.round(f.byte2.value/1000000*100000)/100000 f.gb.value=Math.round(f.byte2.value/1000000000*100000)/100000 f.tb.value=Math.round(f.byte2.value/1000000000000*100000)/100000 } function convertgb(f) { f.byte.value=Math.round(f.gb.value*1000000000*100000)/100000 f.byte2.value=Math.round(f.gb.value*1000000000*100000)/100000 f.kb.value=Math.round(f.gb.value*1000000*100000)/100000 f.mb.value=Math.round(f.gb.value*1000*100000)/100000 f.tb.value=Math.round(f.byte2.value/1000000000000*100000)/100000 f.kib.value=Math.round(f.byte2.value/1024*100000)/100000 f.mib.value=Math.round(f.byte2.value/1048576*100000)/100000 f.gib.value=Math.round(f.mib.value/1024*100000)/100000 f.tib.value=Math.round(f.mib.value/1048576*100000)/100000 } function converttib(f) { f.byte.value=Math.round(f.tib.value*1099511627776*100000)/100000 f.byte2.value=Math.round(f.tib.value*1099511627776*100000)/100000 f.kib.value=Math.round(f.tib.value*1073741824*100000)/100000 f.mib.value=Math.round(f.tib.value*1048576*100000)/100000 f.gib.value=Math.round(f.tib.value*1024*100000)/100000 f.kb.value=Math.round(f.byte2.value/1000*100000)/100000 f.mb.value=Math.round(f.byte2.value/1000000*100000)/100000 f.gb.value=Math.round(f.byte2.value/1000000000*100000)/100000 f.tb.value=Math.round(f.byte2.value/1000000000000*100000)/100000 } function converttb(f) { f.byte.value=Math.round(f.tb.value*1000000000000*100000)/100000 f.byte2.value=Math.round(f.tb.value*1000000000000*100000)/100000 f.kb.value=Math.round(f.tb.value*1000000000*100000)/100000 f.mb.value=Math.round(f.tb.value*1000000*100000)/100000 f.gb.value=Math.round(f.tb.value*1000*100000)/100000 f.kib.value=Math.round(f.byte2.value/1024*100000)/100000 f.mib.value=Math.round(f.byte2.value/1048576*100000)/100000 f.gib.value=Math.round(f.mib.value/1024*100000)/100000 f.tib.value=Math.round(f.mib.value/1048576*100000)/100000 } </script> <script async src="/js/q.js"></script> <script async src="/js/content.js"></script> </head> <body> <!-- #BeginLibraryItem "/Library/head_tools.lbi" --> <div id="tnav"> <ul> <li class="tbtn"><a href="">SS64</a></li> <li class="tbtn"><a href="tools">Tools <svg viewBox="0 0 13 20.1" width="13" height="13" style="transform: rotate(0deg);"> <path d="M0 2.9l7.2 7.2-7.1 7.1L3 20.1l7.1-7.1 2.9-2.9L2.9 0 0 2.9"></path> </svg> </a></li> <li> <div id="search"> <form action="https://www.google.com/search" method="get"> <input type="text" name="q" id="qu" size="27" maxlength="255" aria-label="Search text"> <input class="submit mousetrap" value="Search" id="btn" type="submit"> <input type="hidden" name="sitesearch" value="ss64.com"> <input type="hidden" name="udm" value="14"> </form> </div> </li> </ul> </div> <!-- #EndLibraryItem --> <h1>Convert Units</h1> <p>Convert between Bytes, KB, MB, GB, TB and KiB, MiB, GiB, TiB</p> <div><blockquote> <form> <table id="example"> <tr> <td class="tblhead">Bytes</td> <td class="tblhead">KiB</td> <td class="tblhead">MiB</td> <td class="tblhead"> GiB</td> <td class="tblhead"> TiB</td> <td> </td> </tr> <tr> <td ><input type="text" size="20" name="byte" value="1073741824" class="in" tabindex=1 onblur="return convert1(this.form)"></td> <td ><input type="text" size="20" name="kib" value="1048576" class="in" tabindex=2 onblur="return convertkib(this.form)"></td> <td ><input type="text" size="10" name="mib" value="1024" class="in" tabindex=3 onblur="return convertmib(this.form)"></td> <td ><input type="text" size="10" name="gib" value="1" class="in" tabindex=4 onblur="return convertgib(this.form)"></td> <td ><input type="text" size="10" name="tib" value="0.00098" class="in" tabindex=5 onblur="return converttib(this.form)"></td> <td > </td> </tr> <tr> <td class="tblhead">Bytes</td> <td class="tblhead">KB</td> <td class="tblhead">MB</td> <td class="tblhead"> GB</td> <td class="tblhead"> TB</td> <td><input type="button" name="B2" value="Convert" class="btn1"></td> </tr> <tr> <td ><input type="text" size="20" name="byte2" value="1073741824" class="in" tabindex=6 onblur="return convert2(this.form)"></td> <td ><input type="text" size="20" name="kb" value="1073741.824" class="in" tabindex=7 onblur="return convertkb(this.form)"></td> <td ><input type="text" size="10" name="mb" value="1073.74182" class="in" tabindex=8 onblur="return convertmb(this.form)"></td> <td ><input type="text" size="10" name="gb" value="1.07374" class="in" tabindex=9 onblur="return convertgb(this.form)"></td> <td ><input type="text" size="10" name="tb" value="0.00107" class="in" tabindex=10 onblur="return converttb(this.form)"></td> <td > </td> </tr> </table> </form></blockquote></div> <blockquote> <p>Edit any of the boxes above and click 'Convert'.</p> <p>Computer storage disks and RAM are manufactured in binary units (<abbr title="a number of the form 2^n where n is an integer, that is, the result of exponentiation with number two as the base and integer n as the exponent.">power of 2</abbr>) Bytes, KiB, MiB, GiB…<br> The binary prefix convention (IEC 60027-2) allows common numbers such as 2048 bytes to display as round numbers, so 2 KiB<br> When byte sizes are informally stated with a single size indicator like 500M or 16G you should assume they refer to a power of 2 unit.<br><br> Power of 10 numbers are also calculated above (KB, MB, GB…) these are used by <a href="https://support.apple.com/kb/TS2419">Apple</a> and some hard drive manufacturers.</p> <p>Many documents still incorrectly use the old-style : <span class="code"> KB,MB,GB…</span> prefixes to refer to a power of 2 value.<br> The <span class="code">'B'</span> character for Bytes is case sensitive and easily confused with <span class="code">'b'</span> for bits: <span class="code"> 1 Kb=1000 bits</span> or 125 Bytes (1 Byte = 8 bits)<br> <b>Bytes</b> are used to measure disc/file sizes. <b>bits</b> are used to measure network or download speeds.</p> </blockquote> <p>Convert between Binary, Decimal, Hex and Base 36</p> <blockquote> <table> <tr> <td>Base 36:</td> <td>Hex:</td> <td>Decimal:</td> <td>Binary:</td> </tr> <tr> <td><input type="text" size=10 id="inBase36" tabindex=14 class="cleo" onkeyup="convertBase2Dec()" value="BJ" /></td> <td><input type="text" size=13 id="inHex" tabindex=13 class="cleo" onkeyup="convertHex2Dec()" value="19F" /></td> <td><input type="text" size=16 id="inDec" tabindex=11 class="cleo" onkeypress="return isNumberKey(event)" onkeyup="convertDec2Bin()" value="415" inputmode="numeric" /></td> <td><input type="text" size=52 id="inBin" tabindex=12 class="cleo" onkeyup="convertBin2Dec()" value="110011111" inputmode="numeric" /></td> </tr> </table> </blockquote> <p><b>Typical throughputs:</b><br> Hard disk = 30 MiB per second. (x8 = 240 Mb/Sec)<br> Gigabit Ethernet = 125 MiB per second. (x8 = 1,000 Mb/Sec)<br> Solid State Disc (SATA) = 250 MiB per second. (x8 = 2,000 Mb/Sec)<br> Solid State Disc (NVMe PCIe 4.0) = 2 GiB per lane per second. (x8 = 16 Gb/Sec)<br> Fibre Channel = 2,550 MiB per second. (x8 = 20,400 Mb/Sec)<br> Fibre Channel 256GFC = 49,700 MiB per second. (x8 = 397,600 Mb/Sec)<span class="notes"><br> </span></p> <script> // Restrict Decimal input to 0-9 function isNumberKey(evt){ var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } // Restrict binary input to 1,0 and navigation keys document.getElementById('inBin').addEventListener('keydown', function(ev) { // 48=0 49=1 8=backspace 224=command 86=v 37=left 39=right // 46=delete 17=control 67=c if(ev.keyCode != 48 && ev.keyCode != 49 && ev.keyCode != 8 && ev.keyCode != 224 && ev.keyCode != 86 && ev.keyCode != 37 && ev.keyCode != 39 && ev.keyCode != 46 && ev.keyCode != 17 && ev.keyCode != 67 && ev.keyCode != 9) { ev.preventDefault(); } }); // Restrict Hex input to 0-9 A-F document.getElementById('inHex').addEventListener('keydown', function(ev) { // 0=48 90=z 70=F 8=backspace 224=command 86=v 37=left 39=right 9=TAB // 46=delete 17=control 67=c if(!(ev.keyCode > 47 && ev.keyCode < 71) && ev.keyCode != 8 && ev.keyCode != 224 && ev.keyCode != 86 && ev.keyCode != 37 && ev.keyCode != 39 && ev.keyCode != 46 && ev.keyCode != 17 && ev.keyCode != 67 && ev.keyCode != 9) { ev.preventDefault(); } }); // Restrict inBase36 input to 0-9 A-Z document.getElementById('inBase36').addEventListener('keydown', function(ev) { // 0=48 90=z 70=F 8=backspace 224=command 86=v 37=left 39=right // 46=delete 17=control 67=c if(!(ev.keyCode > 47 && ev.keyCode < 91) && ev.keyCode != 8 && ev.keyCode != 224 && ev.keyCode != 86 && ev.keyCode != 37 && ev.keyCode != 39 && ev.keyCode != 46 && ev.keyCode != 17 && ev.keyCode != 67 && ev.keyCode != 9) { ev.preventDefault(); } }); // Conversion script from //https://gist.github.com/faisalman/4213592 var convertBase = function () { function convertBase(baseFrom, baseTo) { return function (num) { return parseInt(num, baseFrom).toString(baseTo); }; } // binary to decimal convertBase.bin2dec = convertBase(2, 10); // binary to hexadecimal convertBase.bin2hex = convertBase(2, 16); // decimal to binary convertBase.dec2bin = convertBase(10, 2); // decimal to hexadecimal convertBase.dec2hex = convertBase(10, 16); // hexadecimal to binary convertBase.hex2bin = convertBase(16, 2); // hexadecimal to decimal convertBase.hex2dec = convertBase(16, 10); return convertBase; }(); // Decimal to Binary/Hex function convertDec2Bin() { var inputDecimal = document.getElementById("inDec").value; document.getElementById('inBin').value = convertBase.dec2bin(inputDecimal); document.getElementById('inHex').value = convertBase.dec2hex(inputDecimal).toUpperCase(); document.getElementById('inBase36').value = Number(inputDecimal).toString(36).toUpperCase(); } // Binary to Decimal/Hex function convertBin2Dec() { var inputBin = document.getElementById("inBin").value; document.getElementById('inDec').value = convertBase.bin2dec(inputBin); document.getElementById('inHex').value = convertBase.bin2hex(inputBin).toUpperCase(); document.getElementById('inBase36').value = Number(document.getElementById("inDec").value).toString(36).toUpperCase(); } // Hex to Binary/Decimal function convertHex2Dec() { var inputHex1 = document.getElementById("inHex").value; //remove the character 'v' which is allowed for input so that CTRL-V (paste) still works. var inputHex = inputHex1.replace(/v/g, ""); document.getElementById('inHex').value = inputHex.toUpperCase(); document.getElementById('inDec').value = convertBase.hex2dec(inputHex); document.getElementById('inBin').value = convertBase.hex2bin(inputHex); document.getElementById('inBase36').value = Number(document.getElementById("inDec").value).toString(36).toUpperCase(); } function convertBase2Dec(){ var inputBase36 = document.getElementById("inBase36").value; document.getElementById('inDec').value = parseInt(inputBase36, 36); var inputDecimal = parseInt(inputBase36, 36); document.getElementById('inBin').value = convertBase.dec2bin(inputDecimal); document.getElementById('inHex').value = convertBase.dec2hex(inputDecimal).toUpperCase(); document.getElementById('inBase36').value = inputBase36.toUpperCase(); } </script> <p class="quote">“Kilted Men Given Testosterone Perform Exceedingly Zealous Yoga - Mnemonic for Kilo, Mega, Giga, Tera, Peta, Exa, Zeta, Yotta” ~ David Wu</p> <h3>Related</h3> <p class="space"><a href="ascii.html">ASCII Table</a><br> <a href="nt/certutil.html">CERTUTIL</a> - Convert to Base64.<br> <a href="https://ss64.com/ps/syntax-base36.html">Base 36</a> - Convert in PowerShell.<br> <a href="https://www.rapidtables.com/convert/number/hex-to-ascii.html">Hex to ASCII Text</a> Converter - RapidTables.</p><!-- #BeginLibraryItem "/Library/foot_menu.lbi" --><hr> <div id=bl> </div> <div id=br>Copyright © 1999-2025 <a href="https://ss64.com/">SS64.com</a><br> Some rights reserved</div><!-- #EndLibraryItem --></body> </html>