Jim is a young boy who is enslaved to Tom's aunt Polly. He appears only briefly in The Adventures of Tom Sawyer. In the first chapter, Tom tries to trick Jim into whitewashing the fence. Jim insists that he is under strict orders to get to work, but Tom nearly convinces him. In the end, Jim ends up getting chased away by Aunt Polly. He does not take part in any other of Tom's adventures in this book. He does, however, play a central role in its sequel.
In The Adventures of Huckleberry Finn, Jim, now older, is a runaway who was enslaved to Miss Watson. Jim runs away after overhearing that he is about to be sold to a trader in New Orleans. He takes refuge on Jackson's Island, where he encounters Huck. Together, the two then make their way down the Mississippi River on a simple raft.
Over the course of their adventure together, Jim and Huck become unlikely friends. Jim considered Huck to be the only "white genlman dat ever kep' his promise to ole Jim." The two go to great lengths to protect each other as they journey downriver.
Mark Twain's characterization of Jim is an intentional departure from most other contemporary depictions of enslaved people, which tended to present them as one-sided. Jim is a complex person. He is both rational and superstitious. He is intelligent and an expert problem solver. He cares deeply for his family and is willing to risk anything for them. Jim is also deeply loyal to the people who treat him with dignity. He risks his own chance at freedom in order to help save Tom Sawyer's life. At the same time, Jim knows that he owes nothing to those who see him as less than human.