Abstract. We study the coarse geometry of the Teichmüller space of a compact orientable surface in the Teichmüller metric. We describe when this admits a quasi-isometric embedding of a euclidean space, or a euclidean half-space. We prove quasi-isometric rigidity for Teichmüller space of a surface of complexity at least 2: a result proven independently by Eskin, Masur and Rafi. We deduce that, apart from some well known coincidences, the Teichmüller spaces are quasi-isometrically distinct. (See also Lemma 2.5 for further discussion.) We also show that Teichmüller space satisfies a quadratic isoperimetric inequality. A key ingredient for proving these results is the fact that Teichmüller space admits a ternary operation, natural up to bounded distance, which endows the space with the structure of a coarse median space whose rank is equal to the complexity of the surface. From this, one can also deduce that any asymptotic cone is bilipschitz equivalent to a CAT(0) space, and so in particular, is contractible.