We present an algebraic framework which simultaneously generalizes the notion of linear subspaces, matroids, valuated matroids, oriented matroids, and regular matroids. To do this, we first introduce algebraic objects which we call tracts; they generalize both hyperfields in the sense of Krasner and partial fields in the sense of Semple and Whittle. We then define matroids over tracts; in fact, there are (at least) two natural notions of matroid in this general context, which we call weak and strong matroids. We give "cryptomorphic" axiom systems for such matroids in terms of circuits, Grassmann-Plücker functions, and dual pairs, and establish some basic duality results. We then explore sufficient criteria for the notions of weak and strong matroids to coincide. This is the case whenever vectors and covectors are orthogonal, and is closely related to the notion of "perfect fuzzy rings" from [DW92b]. For example, if F is a particularly nice kind of tract called a doubly distributive partial hyperfield, we show that the notions of weak and strong matroid over F coincide. Our theory of matroids over tracts is closely related to but more general than "matroids over fuzzy rings" in the sense of Dress and Dress-Wenzel [Dre86, DW91, DW92a, DW92b].