We bound the second eigenvalue of random 𝑑-regular graphs, for a wide range of degrees 𝑑, using a novel approach based on Fourier analysis. Let G n,𝑑 be a uniform random 𝑑-regular graph on n vertices, and 𝜆(G n,𝑑 ) be its second largest eigenvalue by absolute value. For some constant c > 0 and any degree 𝑑 with log 10 n ≪ 𝑑 ≤ cn, we show that 𝜆(G n,𝑑 ) = (2 + o( 1))√ 𝑑(n − 𝑑)∕n asymptotically almost surely. Combined with earlier results that cover the case of sparse random graphs, this fully determines the asymptotic value of 𝜆(G n,𝑑 ) for all 𝑑 ≤ cn. To achieve this, we introduce new methods that use mechanisms from discrete Fourier analysis, and combine them with existing tools and estimates on 𝑑-regular random graphs-especially those of Liebenau and Wormald.