Homer stops by at the Kwik-E-Mart on the way home from work one night and witnesses a robbery, committed by Krusty the Clown. Krusty is arrested and Sideshow Bob takes over his show. Outside the courthouse, Krusty tells Bart that he didn't commit the crime, and so Bart vows to find out who framed him.
He asks Lisa for help, and they go to the Kwik-E-Mart to find clues. They discover that Krusty wouldn't have been able to use the microwave because he has a pacemaker, and that the robber was also reading - Krusty is illiterate.
The kids go to see Sideshow Bob to find out more information about Krusty and his enemies. But, live on TV, Bart realizes that Sideshow Bob is the imposter who framed Krusty. He has large feet, whereas Krusty has tiny feet - that's why the robber yelled when Homer stepped on his clown shoe. The case is solved and Krusty thanks Bart for always believing in him.