# In what order should unit symbols appear?

I am trying to represent the result of a dimensional analysis calculation and I can't find an official document that lists the order that unit symbols should appear.

For example, when I google $5\text{ m}\times 2\text{ kg}$ or $2\text{ kg}\times 5\text{ m}$ the result is always meters first, or $10\text{ m kg}$. But when I plug both of those calculations into Wolfram Alpha the result has kilograms first, or $10\text{ kg m}$.

I would assume that Wolfram Alpha would take more care in displaying a mathematical results than Google but I would like an official reference (at least for SI) explaining the order unit symbols should appear and if possible other formatting rules.

EDIT: I (as a human) will not be doing the rearranging of the symbols so I am looking for a spec that will produce the same output every time.

-
In principle, the order is not important. But I've noticed that usually, physics books take the order defined by the used formula. For example a force ($F=ma$) would be [$F$]=$kg\ m/s^2$. – Ana May 27 '13 at 15:56
I think people tend to put the uppercase units, which are usually either defined units or electrical ones, before the lowercase units (g, m, s) that represent the basic mechanical quantities. The convention also seems to be to put the lowercase units in mass-length-time order. – Ben Crowell May 27 '13 at 22:09
Also, I think there is a common style in which all units that occur with negative exponents are rewritten after a fraction bar with positive exponents. For example, the units of the gravitational constant G can be written as $\text{N}\cdot\text{m}^2/\text{kg}^2$. If you're looking for a universal canonical order, I don't think there is one, since, e.g., G could also be written as $\text{J}\cdot\text{m}/\text{kg}^2$ if you consider energy rather than force to be primary. The way we write the units also depends on the meaning and context, e.g., J (energy) are the same as N.m (torque). – Ben Crowell May 28 '13 at 0:46

It makes no difference as long as you are clear what the units are. The standard for many people is kg m, but you may see in a lot of places m kg. In general, people usually write it thusly in SI units:
[charge][mass][length][time][temperature]

Unusual units generally go toward the beginning such as this:
[charge][mass][Force][Energy][length][mol][frequency][time][temperature]

-
When you say 'usually' is there a certain context like engineering or science? It looks like Wolfram Alpha displays base units thusly: [mass] [length] [time] [current] [temperature] [amount] [luminous intensity] wolframalpha.com/input/… – Steve Moser May 27 '13 at 16:07
no, there's no context. I just mixed up my temperature and time. Thanks for pointing that out – Jim May 27 '13 at 16:18
and wolfram might not be the best to trust, it puts Newton after meter but lists G in units of $Nm^2/kg^2$ – Jim May 27 '13 at 16:23

Of course, in principle it makes no difference, however, I think there is an important point to be made:

Order the units for maximum physical sense.

Take a simple example, of 'speed'. The units would normally be expressed (in SI) as $\text{ms}^{-1}$, not $\text{s}^{-1}\text{m}$.

This is because we normally think of speed as "how far something goes per time" not "per time, how far something goes". (At least in English).

In my experience, the comment by Anuar is very true, so also take this into account in addition, if possible.

-
Since m can mean either meters or milli-, it makes sense to eliminate the ambiguity either by the order of the factors or by using dots. This would be a reason to express speed as $\text{m}\cdot\text{s}^{-1}$ rather than $\text{ms}^{-1}$ (which could be inverse milliseconds), and work as $\text{N}\cdot\text{m}$ rather than mN (which looks like millinewtons). – Ben Crowell May 27 '13 at 22:06
Thanks for you answer though I might have been a little unclear, I need to ingest a unit and format it without ambiguity while relying a system that doesn't have the smarts of a physics prof. Until I can just tell a computer to 'order for maximum physical sense' I need a spec that I can codify. I'll edit my question. – Steve Moser May 27 '13 at 22:49
@SteveMoser Well, as with most things in life, you're probably going to have to find some compromise. Either make some fancy code, or get a simple algorithm and hope for the best. My answer is what 'what humans want', not 'what computers want', I'm afraid. Either way, best of luck - hope it works out! – user12345 May 27 '13 at 22:57
@BenCrowell IMO, I prefer space rather than dots but yeah, good point, leaving definitely one of those is needed. I should have done this in my question but I'll leave it. I'm not used to typing units, I normally do numerical calculations by hand. – user12345 May 27 '13 at 23:04
@user12345 Your example is helpful. So far I have two heuristics from the answers here: 1) Yours which could be interpreted as 'list units with positive exponents first' 2) BenCrowell's rule of listing uppercase symbols first. – Steve Moser May 28 '13 at 13:32

## protected by Qmechanic♦May 27 '13 at 23:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).