Tom and Huck are both young, naive, and adventurous. Both of them are interesting in doing exciting things, but Huck is more interested in doing things for the right reason.
Twain wrote Huck Finn as a foil, or contrast, to Tom Sawyer. Tom is a simple-minded kid who is only interested in adventures. His conscience is wholly dictated by the social order. Huck, on the other hand, actually thinks for himself. He is the real rebel. While Tom follows fun, Huck follows his conscience.
Huck struggles to develop his conscience throughout the book. A good example of this is his reaction to the idea that people who side with slaves go to Hell. Huck has to decide “forever betwixt, two things,” meaning following his conscience or following society’s norms. He writes a note telling Miss Watson where her runaway slave Jim is, but he cannot send it because Jim has become his friend.
“All right, then, I'll go to hell”—and tore it up. (ch 31, enotes etext p. 141)
By contrast, Tom never questions society’s norms, laws and rules. It never occurs to him to free a slave. He only helps Huck free Jim because he knows Jim is already free, so there is nothing immoral or illegal about it. He concocts a ridiculously complicated and risky scheme, never telling anyone they are freeing a freed slave. Huck thinks he’s doing the right thing, but he is shocked that Tom would. After all, he doesn’t expect Tom to go to Hell.
This changes Huck’s opinion of Tom. Huck thought Tom was intelligent and a good friend. After the incident with Jim, Huck realizes that Tom does not really have a conscience, because he is willing to free the slave. This is illegal and, according to Huck, wrong.
THE FIRST TIME I catched Tom private I asked him what was his idea, time of the evasion?—what it washe'd planned to do if the evasion worked all right and he managed to set a nigger free that was already free before (ch 42, p. 191)
At the end, Huck decides he’s too old for childish games, and he goes off on his own—without Tom Sawyer.
tom is cool huck is a baby