Cottonseed meal (CSM) and rapeseed meal (RSM) are protein sources in livestock feed. However, the applications of both ingredients are limited in diets due to the existence of anti-nutritional factors such as free gossypol and glucosinolate. The aim of this study was to determine the optimal fermentation conditions for reducing anti-nutritional factors and increasing the nutritional value of fermented total mixed rations containing cottonseed or rapeseed meal. An orthogonal design L9 (3(4)) was performed to optimize the fermentation conditions, including fermentation time, temperature, moisture content and microbial strain. Optimum fermentation conditions were performed using different fermentation times (48, 60, 72 h), fermentation temperatures (28 degrees C, 32 degrees C, 36 degrees C), moisture content (40%, 50%, 60%) and microbial inoculations (1 = Bacillus clausii with 1 x 10(9) CFU/kg DM for CSM or 1 x 10(10) CFU/kg DM for RSM; 2 = Saccharomyces cariocanus with 5 x 10(9) CFU/kg DM; 3 = mixed strain (B. clausii:S. cariocanus ratio 1:1). The results show that the concentration of free gossypol content was reduced (p < 0.05), while the crude protein content was increased (p < 0.05) in CSM through optimum fermentation conditions: time 60 h; temperature 32 degrees C; moisture content 50% and inoculated with B. clausii (1 x 10(9) CFU/kg DM) as well as S. cariocanus (5 x 10(9) CFU/kg DM). Likewise, the concentration of glucosinolate was lowered (p < 0.05) and the crude protein was increased (p < 0.05) in RSM through optimum fermentation conditions: time 60 h; temperature 28 degrees C; moisture 50% and inoculated with B. clausii (1 x 10(10) CFU/kg DM) as well as S. cariocanus (5 x 10(9) CFU/kg DM). Our findings indicate that the optimal fermentation conditions of total mixed rations with cottonseed meal or rapeseed meal enhance the nutritional value, thereby making them viable and usable feedstuffs for potential use in livestock industries.