A real-valued invariant of (closed) braids, called the twist number ,i s introduced and studied. This invariant is effectively computable and has clear geo- metric sense. As a functional on the braid group, the twist number is a pseudocharacter (i.e., a function that is almost a homomorphism). It is closely related to Dehornoy's ordering (and to all Thurston-type orderings) on the braid group. In special cases, the twist number coincides with some characteristics introduced by William Menasco. In terms of the twist number, restrictions are established on the applicability of the Markov destabilization and Birman-Menasco moves on closed braids. These restric- tions were conjectured by Menasco (Kirby's problem book, 1997). As a consequence, conditions for primality of the link represented by a braid are obtained. The results were partially announced in an earlier paper.