In this paper, we propose a novel codebook design scheme for orthogonal frequency-division multiplexing with index modulation (OFDM-IM) to improve system performance. The optimization process can be implemented efficiently by the lexicographic ordering principle. By applying the proposed codebook design, all subcarrier activation patterns with a fixed number of active subcarriers will be explored. Furthermore, as the number of active subcarriers is fixed, the computational complexity for estimation at the receiver is reduced and the zero-active subcarrier dilemma is solved without involving complex higher layer transmission protocols. It is found that the codebook design can potentially provide a trade-off between diversity and transmission rate. We investigate the diversity mechanism and formulate three diversity-rate optimization problems for the proposed OFDMIM system. Based on the genetic algorithm (GA), the method of solving these formulated optimization problems is provided and verified to be effective. Then, we analyze the average block error rate (BLER) and bit error rate (BER) of OFDM-IM systems applying the codebook design. Finally, all analyses are numerically verified by Monte Carlo simulations. In addition, a series of comparisons are provided, by which the superiority of the codebook design is thereby confirmed.