How many bytes is it
JavaScript (ES6), 78 74 bytes



f=(n,i)=&gt;n&lt;999.5?i?n.toPrecision(n&lt;1^3)+' KMG'[i]+'iB':n+'B':f(n/1024,-~i)
&lt;input oninput=o.textContent=f(this.value)&gt;&lt;pre id=o&gt;




Edit: Saved 4 bytes thanks to @Arnauld.