Abstract. In this paper we examine subalgebras on two generators in the univariate polynomial ring. A set, S, of polynomials in a subalgebra of a polynomial ring is called a canonical basis (also referred to as SAGBI basis) for the subalgebra if all lead monomials in the subalgebra are products of lead monomials of polynomials in S. In this paper we prove that a pair of polynomials ff; gg is a canonical basis for the subalgebra they generate if and only if both f and g can be written as compositions of polynomials with the same inner polynomial h for some h of degree equal to the greatest common divisor of the degrees of f and g. Especially polynomials of relatively prime degrees constitute a canonical basis. Another special case occurs whe...