The 7th U.S. Circuit of Appeals in Chicago overturned a federal judge's decision upholding the law, saying the "blanket ban" was too broad and didn't protect children.
"It broadly prohibits substantial protected speech rather than specifically targeting the evil of improper communications to minors," the judges said in a 20-page decision.
U.S. District Judge Tanya Walton Pratt ruled in June that the state has a strong interest in protecting children and found that social networking had created a "virtual playground for sexual predators to lurk." She noted that the Internet remains open to those who have been convicted of sex offenses.
The American Civil Liberties Union of Indiana filed the class-action suit on behalf of a man who served three years for child exploitation and other sex offenders who are restricted by the ban even though they are no longer on probation.
Federal judges have barred similar laws in Nebraska and Louisiana.
Officials at the ACLU and the Indiana attorney general's office said they hadn't yet reviewed the ruling and had no immediate comment.