# Built-in unit strings recognized by Quantity?

It’s great that Quantity can utilize Wolfram Alpha to interpret unit strings that it doesn’t recognize, but I need my code to work on machines that do not have Internet access.

Is there a complete list of built-in (i.e. canonical) unit strings recognized by Quantity?

Better yet, is there a programmatic way to produce such a list?

-
Good question! I hope Wolfram notices this question and intends to make the Quantity capability stand alone (I often use compound units and almost always run into this issue). –  David Skulsky Apr 19 '13 at 21:25

This is certainly the optimal way of obtaining the list you are looking for

Quantity;QuantityUnitsPrivate$UnitReplacementRules[[1, All, 1]]  EDIT for v10 (thanks @DavidCreech) In v10 this undocumented variable format has been changed into an association, whose keys are the units. Quantity; Keys[QuantityUnitsPrivate$UnitReplacementRules]

-
Haha, I just came here to post this! Damn you fellow spelunker! –  rm -rf Jan 26 '13 at 20:03
FWIW, this seems to me the optimal way to obtain this list, which incidentally is appropriate. –  Oleksandr R. Jan 27 '13 at 0:55
@OleksandrR. I trust your judgement, editing –  Rojo Jan 27 '13 at 1:10
Haha, nice! The Dispatch object from which this list is extracted is actually built from the downvalues of CalculateUnitsUnitCommonSymbolsKnownUnit0Q, which is the canonical arbiter of whether a unit is valid or not. But since this doesn't change after the QuantityUnits  package is loaded, recovering the list as you do here is surely the most direct approach. –  Oleksandr R. Jan 27 '13 at 1:21
@Rojo Note that in version 10 an association is used, so use Quantity; Keys[QuantityUnitsPrivate\$UnitReplacementRules] if you are using 10. –  David Creech Aug 26 at 20:25

As a partial answer the documentation says:

Supported units include all those specified by NIST Special Publication 811.

This is repeated in Unit Discovery. It also states:

Unit interpretation requires internet connectivity, and can entail additional evaluation time. If speed is a concern, it is advisable to use the canonical unit specification, which can be found using InputForm`.

-