The use of automated fare collection (AFC)systems and automated vehicle location (AVL)systems pro-vides a new way to obtain origin-destination (OD)matrix of public transit.In order to improve existing algorithms,this paper develops an improved algorithm for estimating the OD matrix of public transit using smart card and AVL data, which mainly consists of boarding and alighting location data.Based on analysis of AFC data of public transit passengers, a time correction model for smart card data is developed using the AVL data,in order to improve the accuracy of boarding locations.To optimize the inference of alighting locations,this paper divides trip chains of public transit into 2 major types,continuous and discontinuous,then proposes specific alighting inference models for them according to their distin-guish characteristics.The improved algorithm is applied to study the smart card and AVL data from the City of Suzhou, and its feasibility and validity is validated by the rationality of the results indirectly.The results show that the improved algorithm has an effective progress and easy to be programmed.It can be used to automate the analysis of passenger flows of public transit.