The Sharpe ratio is the average return earned in excess of the risk-free rate per unit of volatility or total risk. Volatility is a measure of the price fluctuations of an asset or portfolio.
Formula for Sharpe Ratio of the asset a: $S_a = \frac{E[r_a - r_f]}{\sigma_a}$
where
$r_f$ - risk free return
$r_a$ - asset return
$\sigma_a$ - standard deviation of the asset return (same as volatility)
Sharpe Ratio can be calculated both for asset or some portfolio with different assets.
The Sharpe Ratio is used to determine how well the return on an asset compensates for the risk taken by the investor.
When comparing two assets with the same expected return, investing in an asset with a higher Sharpe ratio will be less risky. (Same price of assets - pick the one with higher Sharpe Ratio)
Adding diversification should increase the Sharpe ratio compared to similar portfolios with a lower level of diversification.