The bill, which the lower house passed in March, was approved late on Monday by 145 senators, with two abstentions. It still requires another house vote, then royal endorsement.
Of 16,413 convicted sex offenders released from Thai prisons between 2013 and 2020, there were 4,848 who re-offended, according to corrections department figures.
Under the bill, certain sex offenders deemed at risk of re-offending may be given the option to receive injections that reduce their testosterone levels, in return for shorter jail time, providing they have approval of two doctors.
The offenders would be monitored for 10 years and be required to wear electronic monitoring bracelets, according to the bill.
If approved, Thailand would join a small group of countries that use chemical castration, among them Poland, South Korea, Russia and Estonia, plus some U.S. states.
"I want this law to pass quickly," Justice Minister Somsak Thepsuthin said on Tuesday. "I don't want to see news about bad things happening to women again," he said.
Jaded Chouwilai, director of the Women and Men Progressive Movement Foundation, a non-governmental organisation that addresses sexual violence, among other areas, said use of chemical castration would not tackle sex crime.
"Convicts should be rehabilitated by changing their mindset while in prison," he said.
"To use punishment like execution or injected castration reinforces the idea that offender can no longer be rehabilitated."