Ramanujan proved that the inequality π(x)2<logxexπ(ex) holds for all sufficiently large values of x. Using an explicit estimate for the error in the prime number theorem, we show unconditionally that it holds if x≥exp(9658). Furthermore, we solve the inequality completely on the Riemann Hypothesis, and show that x=38,358,837,682 is the largest integer counterexample.