A relative Rota–Baxter operator is a relative generalization of a Rota–Baxter operator on an associative algebra. In the Lie algebra context, it is called an O-operator, originated from the operator form of the classical Yang–Baxter equation. We generalize the well-known construction of dendriform and tridendriform algebras from Rota–Baxter algebras to a construction from relative Rota–Baxter operators. In fact we give two such generalizations, on the domain and range of the operator respectively. We show that each of these generalized constructions recovers all dendriform and tridendriform algebras. Furthermore the construction on the range induces bijections between certain equivalence classes of invertible relative Rota–Baxter operators and tridendriform algebras.