A hierarchy on a set S, also called a total partition of S, is a collection H$$\mathcal {H}$$ of subsets of S such that S∈H$$S \in \mathcal {H}$$, each singleton subset of S belongs to H$$\mathcal {H}$$, and if A,B∈H$$A, B \in \mathcal {H}$$ then A∩B$$A \cap B$$ equals either A or B or ∅$$\varnothing $$. Every exchangeable random hierarchy of positive integers has the same distribution as a random hierarchy H$$\mathcal {H}$$ associated as follows with a random real tree T$$\mathcal {T}$$ equipped with root element 0 and a random probability distribution p on the Borel subsets of T$$\mathcal {T}$$: given (T,p)$$(\mathcal {T},p)$$, let t1,t2,…$$t_1,t_2, \ldots $$ be independent and identically distributed according to p, and let H$$\mathcal {H}$$ comprise all singleton subsets of N$${\mathbb {N}}$$, and every subset of the form {j:tj∈F(x)}$$\{j:t_j \in F(x)\}$$ as x ranges over T$$\mathcal {T}$$, where F(x) is the fringe subtree of T$$\mathcal {T}$$ rooted at x. There is also the alternative characterization: every exchangeable random hierarchy of positive integers has the same distribution as a random hierarchy H$$\mathcal {H}$$ derived as follows from a random hierarchy H$${\mathscr {H}}$$ on [0, 1] and a family (Uj)$$(U_j)$$ of i.i.d. Uniform [0,1] random variables independent of H$${\mathscr {H}}$$: let H$$\mathcal {H}$$ comprise all sets of the form {j:Uj∈B}$$\{j:U_j \in B\}$$ as B ranges over the members of H$${\mathscr {H}}$$.