Don’t trust Google calculator

The term “kilobyte” means 1,024 bytes.

Right?

Usually.

Most people reading this are experienced with computers and know that, in many computing contexts, kilobyte means 1,024 bytes. Descriptions of file sizes, memory, and so on. However, in some situations (and in the minds of most non-technical people; I’ve asked), kilobyte means 1,000 bytes. More importantly, units like kilobit usually mean 1,000 bits rather than 1,024. (Especially in the unit kilobits per second, or kbps, which always means 1,000 bits per second.) Google gets this wrong, and just uses 1,024 for everything. Wrong wrong wrong.

So any time you’re using Google to do computer-related calculations, be very sure you’re getting the result you want. I was first miffed by this when (at work) I stupidly trusted Google’s result about the bit rate requirements for streaming audio, for instance.

At the very least, they should provide a short explanation and disclaimer for calculations involving computer units, to explain the discrepancy to people who don’t know about it, especially given that confusion about the issue has resulted in litigation. Google calculator doesn’t seem like a huge target for lawyers, but they care enough to provide a little warning and disclaimer when you do a currency conversion:

Rates provided for information only – see disclaimer. More about currency conversion.

Even better, they could just do it right. Unambiguous units have been around since 1999, and have been adopted by standards organizations and open-source software.

Ironically, Google is aware of these units, but still uses 1,024 for both. For shame.


Update January 2008

I’ve actually talked to one of the employees who worked on Google Calculator.  He had already largely convinced the other maintainers that they should fix this, but left the company before he had a chance to implement it.

I’ve since discovered that GNU Units implements a lot of the same functionality, but:

  • You can use it offline, without webpage-loading delay.
  • It handles a lot more units and prefixes.
  • You can create your own units in a ~/.units.dat file.
  • It uses the standard definitions for “kilobyte”, “kB”, and “KiB”.
  • It runs on Unixes, Apples and Windows.

Yay!

> units -1v "3 kilometers + 500 feet" yards
	3 kilometers + 500 feet = 3447.5066 yards

> units -1v "16 bit * 44.1 kHz * 2" kbps # Compact disc bit rate - Google gets this wrong.
	16 bit * 44.1 kHz * 2 = 1411.2 kbps

> units -1v "5 million pounds" megakilogram
	5 million pounds = 2.2679619 megakilogram

> units -1v "one hundred V / 5 ohms" A
	one hundred V / 5 ohms = 20 A

> units -1v "1/(2*pi*sqrt(10*microF*100 mH))" Hz # resonance frequency of an LC circuit
	1/(2*pi*sqrt(10*microF*100 mH)) = 159.15494 Hz

> units -1v "sqrt(mu0/epsilon0)" ohm # impedance of free space
	sqrt(mu0/epsilon0) = 376.73031 ohm

> units -1v "sqrt(4 k stdtemp 1 kohm (20 kHz - 20 Hz))" nanovolt # thermal noise of a resistor
	sqrt(4 k stdtemp 1 kohm (20 kHz - 20 Hz)) = 548.99727 nanovolt

> units -1v "furlong per fortnight" cm/minute
	furlong per fortnight = 0.99785714 cm/minute

> units -1v attoparsec/microfortnight inch/sec
	attoparsec/microfortnight = 1.0043268 inch/sec

Unfortunately, it cannot calculate the answer to life the universe and everything, but you should probably have that memorized, anyway.  You know, just in case…