Novel matrix-valued imaging techniques such as diffusion tensor magnetic resonance imaging require the development of edgepreserving nonlinear filters. In this paper we introduce a median filter for such tensor-valued data. We show that it inherits a number of favourable properties from scalar-valued median filtering, and we present experiments on synthetic as well as on real-world images that illustrate its performance.