A customized bus (CB) system is an emerging public transportation that aims to provide direct and efficient transit services for groups of commuters with similar travel demands. Existing CB systems aggregate similar travel demands and plan bus lines manually, which is inefficient and costly. In this paper, we propose a CB line planning framework called CB-Planner, which is applicable to multiple travel data sources. A mathematical programming formulation is proposed to simultaneously optimize bus stop locations, bus routes, timetables and passengers’ probabilities of choosing CB. We then developed a heuristic solution framework that includes a grid-density based clustering method for discovering potential travel demands efficiently, a bus stop deployment algorithm to minimize the number of stops and walking distance, and dynamic programming based routing and timetabling algorithms for maximizing estimated profit. We conduct an experiment on a small-scale network to verify the performance gap between the optimal solution and our proposed heuristic solution. A case study is then conducted on one-month taxi trajectory data in Nanjing, China. The study demonstrates that CB lines generated by our CB-Planner can achieve higher profit compared with baseline methods, and they also provide efficient transit services with short walk distances and small departure time adjustments. The moderate increase in travel time is paid off by the significant savings in travel fare.