To address system goodput and energy efficiency enhancement, this paper studies packet size optimization for IEEE 802.15.4 networks. Taking into account of the CSMA-CA contention, protocol overhead, and channel condition, new analytical models are proposed to calculate the goodput and the energy consumption. Optimal packet sizes are derived from the new models for different network scenarios. The analytical results are validated by the simulation results. The results from our work can be used to facilitate efficient packet segmentation. © 2009 IEEE.