Justice Ginsburg, known affectionately to her supporters as the "Notorious RBG", will appear as a Lego minifigure - complete with gavel and robes.
She was not required to do voice work for the film, but has given filmmakers permission to use her likeness.
The Lego Movie 2: The Second Part - a sequel to the 2014 film The Lego Movie - is due to be released on 8 February.
Producers Chris Miller and Phil Lord say they were "trying to think of people who should be immortalised in Lego and who seem fun at weddings" when they decided to include the judge.
Her character has already made its first appearance, in a trailer posted to The Lego Movie's Instagram page yesterday.
The film will be about two siblings playing with their own Lego universe and, according to director Mike Mitchell, Justice Ginsburg will be part of the world invented by the creative younger sister.
"These movies are so full of surprises," Mr Mitchell told USA Today. "And we were thinking, 'who's the last person you would think to see in a Lego film as a minifig?' - Ruth Bader Ginsburg!"
The judge, who had cancer surgery last month, hasn't recorded any audio for the film - but the filmmakers say she's given it her blessing.
"She said, 'Of course, I'd love to be a Lego figure. That would be cool,'" Mr Mitchell says.
More about: Lego