Newton's law of universal gravitation says every mass attracts every other mass with a force proportional to the product of the masses and inversely proportional to the square of the distance between their centres. The constant of proportionality, G, is tiny, 6.674 x 10^-11 in SI units, which is why you do not feel the gravitational pull of a building as you pass it: everyday masses are far too small for their attraction to register against Earth's enormous pull. The inverse square fall-off shapes everything astronomical. Double the distance and the force quarters; that single pattern explains the shapes of orbits, the variation of tides, and why a planet's surface gravity depends on both its mass and its radius, not on mass alone.
Your weight is the gravitational force between you and the planet beneath you, measured in newtons. On Earth's surface, gravity gives every kilogram 9.81 newtons of weight, using the average field strength g. Stand on the Moon and the same body weighs about a sixth as much, because the Moon's mass and radius combine to a surface gravity of 1.62. On Mars the figure is 3.71. The weight calculator on this site shows all three at once, and the comparison teaches the real lesson: weight is a relationship between you and a place, not a property of you. Astronauts in orbit still have nearly their full Earth weight in gravitational terms; they feel weightless because they are in free fall, falling around the planet alongside their spacecraft.
Combine the gravitation law with the measured g at the surface and algebra hands you the mass of the Earth itself: g times the radius squared, divided by G. Henry Cavendish first measured G in a laboratory in 1798, with lead spheres and a twisting wire, and his experiment was celebrated as weighing the world. The same law, run in reverse, lets astronomers weigh distant planets from the orbits of their moons, and stars from the planets around them. Few formulas earn their keep at so many scales at once, from the apple that supposedly started the story to the exoplanets in this morning's astronomy news. The gravitational force calculator on this site applies the law directly; try two one kilogram masses a metre apart to feel how small G makes ordinary attraction, then try planetary masses to watch it run the solar system.
Every mass attracts every other mass. Newton's law of universal gravitation gives the force between two masses separated by a distance.
Open the calculator