In this paper we construct canonical bases for the Birman-Wenzl algebra BWn, the q-analogue of the Brauer centralizer algebra, and so define left, right and two-sided cells. We describe these objects combinatorially (generalizing the Robinson-Schensted algorithm for the symmetric group) and show that each left cell carries an irreducible representation of BWn. In particular, we obtain canonical bases for each representation, defined over Z. The same technique generalizes to an arbitrary tangle algebra and Rmatrix [R]; in particular to centralizers of the quantum group action on V ⊗r, for V a finite dimensional representation of a quantum group. BWn occurs for particular values of the parameters (q, r, x) as the centralizers of the action of Uqsp2k or Uqok on the n-th tensor power of its standard representation V . One may presumably transfer the bases of the BWn modules to give a basis of representations occurring in V ⊗n (as in [GL]), and it is natural to conjecture that the basis so obtained coincides with that of [L,§27]. Of the Weyl groups, only in the symmetric group are the cell representations irreducible. In this respect BWn is similar to Sn. One would expect this because of the relation with quantum groups, which also behave like Hecke algebras of type A [L]. Moreover, our main new insight into the structure of BWn is precisely of this form—we show that every representation is induced from a representation of a symmetric group in a precise way (see §6.5). This paper is essentially self-contained, except for an appeal to the solution of the corresponding problem for Sn in [KL,1.4]. In particular, we make no further mention of quantum groups and use no previous work on the structure of BWn (e.g. [BW,HR,W]) except for its description as a