Orthogonal experiments were conducted to determine for the effect of frequency, power, reaction time, and mixing ratio on the co-pyrolysis characteristics and products of bagasse and municipal sludge. After ultrasonic pretreatment, the carbon content in the sample increased and the nitrogen content decreased. The thermogravimetric analysis results revealed that the pyrolyzed ultrasonic samples only had one peak, and the maximum mass loss rate and comprehensive pyrolysis characteristic index (D) values increased. Range analysis revealed that experimental conditions of 45 kHz, 200 W, and 2 h assisted in decreasing the residue, whereas 45 kHz, 200 W, 1 h assisted in increasing D. The GC/MS results revealed that the main components of the co-pyrolyzed bagasse and sludge were hydrocarbon, ketone, phenol, ether, alcohol, aldehyde, acid, ester, furfural, furan, allose, and nitrogen-containing. The proportion of ketones, phenols and alcohols increased rather noticeably after pretreatment. The proportion of hydrocarbon, furan, allose, and nitrogen-containing compounds decreased noticeably. The acid proportion decreased when CaO was added. Lower frequencies and lower powers assisted in increasing the phenol and alcohol ratios and decreasing the acid ratio. The addition of CaO could promote the formation of phenol and alcohol, and might reduce the proportion of acid.