For r ≥ 3, let fr : [0, ∞) → [1, ∞) be the unique analytic function such that fr( k r ) = k−1 r−1 for any k ≥ r − 1. We prove that the spectral radius of an r-uniform hypergraph H with e edges is at most fr(e). The equality holds if and only if e = k r for some positive integer k and H is the union of a complete r-uniform hypergraph K r k and some possible isolated vertices. This result generalizes the classical Stanley's theorem on graphs. √ 1+8e−1 2. The equality holds if and only if e = k 2 and G is the union of the complete graph K k and some isolated vertices. Friedland [7] proved a bound which is tight on the complete graph with one, two, or three edges removed or the complete graph with one edge added. Rowlinson [17] finally confirmed Brualdi and Hoffman's conjecture, and proved that G e attains the maximum spectral radius among all graphs with e edges.