Price is the monetary value of a good, service or resource established during a transaction.
Earnings are the sums of money that you earn by working.
Formula to calculate price to earnings ratio (P/E ratio).

The price per share, is the amount paid or received for a given share of stock. The price per share can help investors decide whether a given company’s stock is worth buying.
Earnings per share is the monetary value of earnings per outstanding share of common stock for a company.
A higher P/E ratio shows that investors are willing to pay a higher share price today because of growth expectations in the future.
Example:
A company’s price per share amounts to $ 2. Its earnings per share is $ 1. Calculate the company’s price to earnings ratio.

Therefore, the company’s P/E ratio is 2.