Let X be a magma, that is a set equipped with a binary operation, and consider a function α: X → X. We say that X is Hom-associative if, for all x, y, z ∈ X, the equality α(x)(yz) = (xy)α(z) holds. For every isomorphism class of magmas of order two, we determine all functions α making X Hom-associative. Furthermore, we find all such α that are endomorphisms of X. We also consider versions of these results where the binary operation on X and the function α only are partially defined. We use our findings to construct numerous examples of two-dimensional Hom-associative as well as multiplicative magma algebras.