Acceleration due to gravity g near the surface of a planet of mass M and radius R is given by:
G is the Universal constant.
Let the mass of body be m.
According to universal law of gravitation:
F=GMmR2
From Newton's second laws of motion,
F=mg
From above two equations,
mg=GMmR2
g=GMR2