If someone asked you to weigh the planet – assuming you haven't paid much attention during physics in high school – you might not know where to start. How do you weigh a thing you're standing on? That's like being asked to weigh your own scales without using a second set of scales.
If you're struggling, don't despair. Figuring out how to weigh (well, measure the mass) of the Earth took until 1687, and even then we couldn't calculate it until 1798.
At the end of the 1600s, Newton proposed the universal law of gravitation: that every particle attracts every other particle in the universe with a force (F) determined by their masses (M) and the square of the distance between the centers of the objects (R). Math fans may prefer it expressed like this: F=G(M1xM2/D2)
As you can tell from the math, if you have the mass of one of the objects (and all the other information within the equation) you can figure out the mass of the second object. Say you were one of the known masses (or you used a specific weight for ease): you could calculate the weight of the Earth, given that we know roughly how far we are from the Earth's center. The problem was, in Newton's time we did not have a value for G, making this impossible.
Newton thought that measuring the gravitational force of an object was not possible for objects smaller than planets and moons. However, this was not the case. Knowing the mass and density of the Earth would be incredibly useful for astronomers, as it would help them calculate the mass and density of other objects in the Solar System, as well as it being interesting to know in its own right. In 1772, the Royal Society set up the “Committee of Attraction” to figure this out.
Attempts were made to measure the average density of the Earth using a mountain in Scotland. The team showed that the sheer mass of Schiehallion attracted pendulums towards it. Measuring the pendulum's movement and surveying the mountain, they were able to calculate a rough density of the Earth.
In 1797, however, we finally got the value of G, allowing us to calculate the mass of the Earth. Geologist Reverend John Michell had been working on the problem, but wasn't able to finish on account of he became dead. Instead it fell to scientist Henry Cavendish, using Michell's equipment, to perform the experiment.
Using a relatively simple setup (see above YouTube video from MrLundScience) Cavendish was able to measure the force between two metal spheres separated by a known distance. The gravitational force of the Earth exerted on the smaller ball could be measured by weighing it, and the density of the balls was also known.
Looking at the ratio between the two forces revealed the mass of the Earth, about 5,974,000,000,000,000,000,000,000 kilograms (13,170,000,000,000,000,000,000,000 pounds), if you're interested.