It's feared it'll scare tourists away from popular places like Bali.
Sex outside marriage has been banned in Indonesia for both locals and tourists.
Anyone who is found guilty of breaking the new law puts themselves at risk of a year in prison.
Meanwhile couples living together who aren't married can be put behind bars for 6 months.
It will take three years to come into effect, but some Indonesians fear it'll scare tourists away from holiday spots like Bali.
BBC News reports that groups of mostly young people protested against the legislation outside parliament in Jakarta this week. It's expected the new laws will be challenged in court.
The new laws mean that unmarried couples caught having sex could be jailed for up to a year. They're also prohibited from living together and couples who do so could face a six month prison sentence.