This paper studies the optimum conceptual design of pile foundations at the initial design stage. A modular method is proposed, which divides the foundation into modules and each module is identified by its characteristics of pile length, diameter, number and layout. Modules with the same characteristics may be packed and represented by a design variable. A minimum-cost optimization model with multiple design constraints based on Chinese code and a cardinality constraint is built to achieve the concurrent optimization of pile size and layout. The model is solved by the improved automatic grouping genetic algorithms to obtain the design with optimal variables and optimal variable grouping. A practical example demonstrates the effectiveness of the proposed approach.