We study Hecke algebras of groups acting on trees with respect to geometrically defined subgroups. In particular, we consider Hecke algebras of groups of automorphisms of locally finite trees with respect to vertex and edge stabilizers and the stabilizer of an end relative to a vertex stabilizer, assuming that the actions are sufficiently transitive. We focus on identifying the structure of the resulting Hecke algebras, give explicit multiplication tables of the canonical generators and determine whether the Hecke algebra has a universal C*-completion. The paper unifies algebraic and analytic approaches by focusing on the common geometric thread. The results have implications for the general theory of totally disconnected locally compact groups.