In this paper, a legged robot is modeled as a floating-base tree-type system where the foot-ground interactions are represented as external forces and moments. Dynamic formulation thus obtained is independent of the configuration or state of the legged robot. Framework for dynamic modeling is proposed with the concept of kinematic modules, where each module is a set of serially connected links. Legged robots are then considered to have several kinematic modules, and kinematic constraints among these modules are obtained in a similar way as those between the links. The latter approach turns out to be a special case of the former where each module has only one link. A velocity transformation based approach is used to obtain the minimal-order equations of motion, and module-level analytical expressions for the vectors and matrices appearing in them. Recursive algorithms for inverse and forward dynamics are proposed by using inter- and intra-modular recursions for the first time. Analyses of a planar biped and spatial quadruped are presented using the proposed methodology. Effectiveness of the proposed algorithms to model-based control schemes is also provided. © 2011 Elsevier Ltd All rights reserved.