In college physics experiments, a pendulum is often applied to measure the moment of inertia (J) of a rigid body. In this paper, we demonstrate a trifilar pendulum to determine not only J, but also the mass (m) of an irregular object. To this end, a standard weight is used to balance the pendulum, and a laser pointer is used to observe the amount of imbalance. According to the parallel axis theorem, a formula is deduced for the first time, which is related with m, J, oscillation period (T) of the pendulum, and the position (d) of the balancing standard. By the least squares fitting of a straight line to the experimental data of T 2 ∼ d 2, m and J can be obtained from the slope and intercept, respectively. It is found that the relative differences (between the experimental and theoretical values) of m and J are both less than 5.0% when four irregular objects (a tuning fork, a stainless steel meter ruler, an apple, and a bunch of keys) are tested. The reason for the difference and the improvement of this measuring system are discussed.