The legislative bill went into effect immediately after state governor Jerry Brown signed it Tuesday.
Anyone convicted of "illegally distributing private images with the intent to harass or annoy" could also face a fine of up to $US1000 ($A1100).
"I want to thank Governor Brown for recognising that this bill was needed," said state senator Anthony Cannella, who proposed the legislation including an "urgency clause" to fast track it into force.
"Until now, there was no tool for law enforcement to protect victims .. Too many have had their lives upended because of an action of another that they trusted," he added.
Legislation already exists against posting unauthorised pictures of other people which invade their privacy, but the new California law covers pictures that were taken with consent, for example when a couple was together, but which are later posted online without the ex-partner's agreement.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
"Revenge porn often begins when relationships end," said Cannella, who noted that there are even websites which "specialise in posting such materials, and charge the subjects unreasonable fees to take down the illicit photos."
Dr Charlotte Laws, whose daughter was a victim of revenge porn, said: "I am thrilled to see California taking a leadership role in protecting victims of revenge porn."
