A distance measure between two trees is proposed. Using the idea of language transformation, a tree can be derived from another by a series of transformations. The distance between the two trees is the minimum-cost sequence of transformations. Based on this definition, an algorithm that generates the distance for any two trees is presented. Cluster analysis for patterns represented by tree structures is discussed. Using a tree-to-tree distance, the similarity between patterns is measured in terms of distance between their tree representations. An illustrative example on clustering of character patterns is presented.