See the Math Law of Universal Gravitation

Newton's law of universal gravitation is:

Newton's Law of Universal Gravitation gif

Here, F  is the attractive force that particle 1 with mass, m1, exerts on particle 2 with mass, m2, is the direction vector from particle 1 to particle 2, and G is the universal gravitational constant that has the same value for all particles. Measurements show that G has the value 6.67 x 10-11 Nm2/kg2. This equation also embodies Newton's third law of motion. By switching the labels of the particles, the force that particle 2 exerts on 1 is equal in magnitude but opposite in direction because only changes sign.