Abstract. We define a total ordering of the pure braid groups which is invariant under multiplication on both sides. This ordering is natural in several respects. Moreover, it well-orders the pure braids which are positive in the sense of Garside. The ordering is defined using a combination of Artin's combing technique and the Magnus expansion of free groups, and is explicit and algorithmic.By contrast, the full braid groups (on 3 or more strings) can be ordered in such a way as to be invariant on one side or the other, but not both simultaneously. Finally, we remark that the same type of ordering can be applied to the fundamental groups of certain complex hyperplane arrangements, a direct generalization of the pure braid groups.