Abstract This paper presents a matrix formulation for the dynamic analysis of planar mechanisms consisting of interconnected rigid bodies. The formulation initially uses the rectangular Cartesian coordinates of an equivalent constrained system of particles to define the configuration of the mechanical system. This results in a simple and straightforward procedure for generating the equations of motion. The equations of motion are then derived in terms of relative joint coordinates through the use of a velocity transformation matrix. The velocity transformation matrix relates the relative joint velocities to the Cartesian velocities. For the open-loop case, this process automatically eliminates all of the non-working constraint forces and leads to an efficient integration of the equations of motion. For the closed-loop case, suitable joints should be cut and few cut-joints constraint equations should be included for each closed loop. Two examples are used to demonstrate the generality and efficiency of the proposed method.