A character foil, or foil character, is a character whose qualities are the opposite of the main character’s. The purpose of a character foil is to highlight the opposite traits of the main character. Character foils are usually sidekicks or enemies of the main character.
Here are examples of character foils with whom you might be familiar. In the show The Simpsons, moral goody-goody Ned Flanders is Homer’s enemy (Homer thinks so anyway) and foil to amoral, shallow Homer. Tom Sawyer and Huckleberry Finn are foils to each other in their respective novels. Huck Finn believes in following society’s rules, while Tom Sawyer questions authority at every turn. In the Harry Potter series, lazy Ron and driven Hermione are foils to each other but are also foils to Harry. Harry is wealthy but has no family. Ron, on the other hand, has a large, loving family, but everything he owns has been handed down to him from his older brothers. As for Hermione, she generally follows the rules, while Harry usually prefers to go his own way.