The Senate voted 39-0 Wednesday to approve the bill. It passed the Assembly in March.
The bill targets "sexting," the practice of sending explicit photos by cell phone, email or Internet posts. The nationwide problem has confounded parents, schools and police.
The bill gives first-time offenders the chance to complete an education program.
Lawmakers took up the issue after a 14-year-old girl allegedly uploaded nude pictures of herself and was arrested on child pornography charges last summer. She eventually received probation and court-ordered counseling.
Christie spokesman Kevin Roberts says the governor will review the legislation but hasn't indicated whether he will sign it.