A **magma**, denoted by (M,•) is an algebraic structure that consists of a set M and a binary operation • closed on M.

The term *groupoid* is also a commonly used term for a magma, but a different algebraic structure with the same name was coined. For this structure, see Groupoid.