How does a commercial airliner measure its weight/mass?
Short answer

Determination of mass and balance (or weight and balance) is a critical task for the crew, an error in this operation may have tragic consequences. 


Weighing passengers and carry-on items is mandatory per regulation.
Either standard predetermined weights, or actual weights can be used in this operation. Airlines usually use predetermined tables. Tables values take into account different types of travel (e.g. regular and charter).
While the weight must be checked, the center of gravity location is of equal importance. The distribution of the passengers in the aircraft is also taken into consideration.
Aircraft are not weighed prior to each flight, but the basic empty weight must be known and checked periodically per regulation.
Aircraft are weighed simply using scales under the carriages :-)

(source)
The other method is to use jacks. See further below for an image.


So this was the short answer. To understand why and how to balance the aircraft, there are quite a lot elements to introduce. For those interested, just continue!



Weight...

The different elements composing the takeoff weight:

  

All of these elements must be determined prior to taxi and takeoff.

The mass of these elements are necessary to check that the different maximum weights are not exceeded. However there is another aspect of the masses which needs to be secured: Where are the masses located?


Taking KeithS' example, if there are many heavy people grouped in the forward section, we may have a problem at Vr, even if the MTOW is not exceeded.




... and balance. Location of the center of gravity vs. the MAC

The masses must be distributed so that the center of gravity of the aircraft is located within limits determined relatively to the aerodynamic chord, and the center of lift.

This is required to ensure the stability and the maneuverability, to minimize the efforts on the horizontal and vertical stabilizers and to increase the maximum lift and reduce the drag. On airliners, the center of lift must be located between the CG and the center of lift of the horizontal stabilizer, so that the latter pushes downward to balance the weight.

  

On airliners the width of the wing is greatest where it meets the fuselage at the wing root and progressively decreases toward the tip. As a consequence, the chord also changes along the span of the wing. The average length of the chord is known as the mean aerodynamic chord (MAC).


The MAC is a portion of the wing, delimited by LeMAC (leading, 0%) and TeMAC (trailing, 100%). The CG must be located in the MAC.

In large aircraft, center of gravity limitations and the actual center of gravity are often expressed in terms of %MAC (on the roll axis, similar limits exist on the two other axis). 


(image and text around: Aircraft Design, Mohammad H. Sadraey)

In general, in large transport aircraft, the most forward CG is located as forward as 5% MAC, while the most aft location as aft as 40% MAC. The average CG limits in large transport aircraft are between 20 and 30% MAC.

As commented by Calchas, using wrong weights for the passengers (adults instead of children) may move the CG to a wrong location, not balanced by the trim, and create strong difficulties during the takeoff and the initial climb.



PAX weight applicable procedures

For an airliner, the PAX portion is relatively small compared to the total mass, so the passengers mass is usually estimated based on standard passenger mass tables and the number of PAX per cabin section. Each airline may provide its own standard mass tables, but standard tables are proposed with the applicable regulation:


JAR-OPS1 or EU-OPS1 for Europe (section JAR - OPS 1.620 Mass values for passengers and baggage). Values valid in 2008:



(source)
Those tables have been establish using airlines data obtained by surveys. They are updated from time to time.
In case the operator wants to establish their own equivalent tables, JAR - OPS 1.620 provides a detailed operating mode to sample passengers and weigh them.


For the EU, a new survey was conducted by the European Aviation Safety Agency in 2009 and a proposal for table updates issued:


Passenger and Baggage weight survey



At this point you may want to download the documentation I'm mostly using for this post: Mass and Balance in Aircraft. We are at page 54.



Special cases

There are cases where it is obvious the actual mass and balance will be erroneous if the standard tables are used (this is especially true for a small cabin).

In these cases the operator must improve the evaluation by actual weighing of either all or a sample of passengers and their baggage. The procedure already mentioned for establishing standard tables is used (JAR - OPS 1.620).



Putting all elements together

All masses, arms (distance to the reference center) and moments are finally reported on the aircraft manifest to calculate the correction that must be used for the takeoff (trim amount).





Basic empty weight determination

The aircraft is not weighed for each takeoff, still it has been weighed to determine its basic empty weight and its center of gravity. This operation must be done every 3 or 4 years (9 or 18 years in a large fleet, this is a specific process) according to JAR Ops 1.605, Appendix 1.

Platform scales under the carriages may be used:


(source)

Another method is to use jacks equipped with a transducer at their top:


(source)



Related FAA regulations and JAR-OPS


FAA AC 120-27E and JAR-OPS 1.620 to determine the mass of the baggage, passengers and carry-on items.
FAA AC 120-27E, JAR-OPS 1.607, JAR-OPS 1.615 for the determination of operational items, which include the crew and the crew baggage (there is also a table, that I won't include to prevent comments on the differences with the passenger table -- All tables are based on survey from airlines). The operational items also include catering, emergency equipment, spare parts..




May be interesting too:


There is a confirmed trend of weight increase among the population (including myself). This has an impact on the operational costs. The way airlines manage this impact can be read in a two-part article: The true costs of heavier passengers, part 1, part 2.




Related:


Do some airplanes have weighing scales on the landing gear?
Do airlines weigh passengers and baggage before loading the aircraft?
How much time does it take to calculate the leveling and weighing of big and small aircraft?