The revised code, known as the KUHP Baru, came into effect on January 2 and replaces a Dutch-era penal law.
It introduces a range of new offences, including provisions on personal conduct that have drawn particular attention from international visitors.
One of the most controversial elements of the new code criminalises sex outside of marriage and cohabitation by unmarried couples.
Under the law, consensual sex outside marriage may be punishable by up to one year in prison, while cohabitation can carry penalties of up to six months in prison.
However, legal experts and Indonesian authorities stress a key nuance: cases can only proceed if a formal complaint is filed by a legal spouse, parent or child – not simply at the initiative of police or officials.
This distinction is critical for assessing how these provisions apply to foreign visitors.
“Foreign tourists cannot be arrested, raided, or prosecuted simply for staying or residing with a partner, unless there is a valid complaint from these parties,” Legal expert and founder of the People’s Law Centre, Retno Murni, told news.com.au
Indonesian officials, including Bali’s governor and tourism authorities, have publicly stated that the intent is not to target tourists or to conduct random checks on hotel guests.
Authorities say hotels and accommodation providers will not be required to ask for marriage certificates and enforcement is expected to focus on domestic complaints rather than proactive policing of visitors’ private behaviour.
Nevertheless, the code’s high-profile morality provisions have drawn international scrutiny and concern.
Travel advisories from foreign governments, including Australia, have encouraged citizens to familiarise themselves with local laws before travelling.
Some industry analysts warn that even if enforcement against travellers remains unlikely, the perception of stricter moral laws could influence traveller confidence and decision-making in the short term.
Beyond personal conduct rules, the new criminal code modernises other parts of Indonesia’s legal framework, including expanded definitions of offences and updated sanctions that align more closely with contemporary Indonesian values, according to government statements.
Tourism stakeholders in Bali, which welcomed millions of international visitors prior to the code’s implementation, emphasise that respectful behaviour, awareness of local customs and adherence to Indonesian laws remain the best way for visitors to avoid issues.

