How do you weigh something that's weightless? No, it's not a koan. It's a scientific question that astronauts living or traveling in space need a concrete answer to, and this is how they get it.
The question of weight in space is not merely one of curiosity. Engineers need to know precise cargo weights to calculate trajectories, and astronauts who are living in space for long stretches of time need to be able to monitor any fluctuations in their own weight as a marker for their bone and muscle health in zero-gravity.
So how they do it? It depends, first, on what it is they're weighing. In the case of objects, it is far likelier that the measurement will be done using on the ground calculations, not with an actual scale. The ESA's Kirsten Macdonell, who is responsible for supervising the ISS's Automated Transfer Vehicle, explains:
The answer is, although the mass of ATV, including its trash, must be known, nothing is weighed on orbit. Everything has already been weighed on the ground before launch. Therefore, when an item is trashed we already know its mass from before it was launched. For items like food waste and used clothing, there are dedicated waste loading bags in which to put this waste. The average mass of these bags, filled with either used food containers or clothing, has been calculated from measurements on the ground and these values are used as the mass of the trash bag on orbit. Even the foam used in packing hardware is weighed before launch and is tracked by part numbers so that we know its mass when it gets trashed.
Of course, the calculation is not quite so simple when you're not weighing an object, but weighing a person. So when astronauts need to calculate their own mass, they approach it in a roundabout way: They calculate force instead, using a dual-springed device called the Space Linear Acceleration Mass Measurement Device (SLAMMD).
As the name suggests, it slams a constant (though relatively small) force against the astronaut in question. From there, it's a simple matter of using Newton's Second Law of Motion to calculate mass. Here's a picture of astronaut Koichi Wakata using the machine:
Top image: Astronauts Shane Kimbrough and Sandra Magnus on Space Shuttle Endeavour / NASA, Bottom image: Koichi Wakata on the ISS / NASA.