Side weirs in trapezoidal canals are used to regulate and measure flow in drainage networks and irrigation systems. In this study, the discharge coefficient of a side weir in a trapezoidal canal is predicted using gene expression programming (GEP). The effects of Froude number (Fr), ratio of side weir length to trapezoidal canal bottom width (L/b), ratio of side weir length to flow depth upstream of the side weir (L/y1), trapezoidal canal side wall slope (m) and ratio of flow depth upstream of the side weir to main canal bottom width (y1/b) are studied on the side weir discharge capacity in a trapezoidal canal. A superior model is introduced as a function of parameters Fr, L/b, L/y1, m and y1/b. In testing the superior model, the calculated RMSE and MARE were 0.011 and 0.024, while the scatter index and BIAS values obtained for this model were 0.030 and 0.009, respectively. Also in model testing, 18.8% of data showed 5–10% error and 81.3% of data had less than 5% error. The correlation coefficient value and average discrepancy ratio calculated for the optimal model selected were 0.916 and 0.995, respectively. Copyright © 2017 John Wiley & Sons, Ltd.