The Sharpe ratio is calculated by subtracting the risk-free rate of return from the expected return of the investment and dividing the result by the standard deviation of the investment returns. The higher the Sharpe ratio, the better the risk-adjusted performance of the investment.