The single most important character in Shakespeare's Hamlet is the eponymous protagonist, Hamlet himself. He has the most lines of any character in the play and the plot revolves around his actions and decisions. He is a complex character whose personality and decisions change over the course of the play and he has among the most impressive and quoted soliloquies in drama, including "To be or not to be ..." in "nunnery scene" of act 3.
Claudius, the new King of Denmark, is Hamlet's antagonist in the play. As the primary antagonist, he is normally considered second in importance to Hamlet himself, and is a perennial favorite with actors and audiences. His actions in killing Hamlet's father (his own brother) and marrying Hamlet's mother Gertrude set the events of the play in action. He is a complex "smiling villain" who is important in that rather being just a narrow stereotype of evil is instead charming and intelligent with a degree of moral complexity.
Of the remaining characters, many can be ranked as the next three in importance. Ophelia is Hamlet's love interest and is central as such. Her character has several important speeches and helps advance the plot. The scene in act 3 where Hamlet tells Ophelia "get thee to a nunnery" is important in developing the feigned madness plot. Ophelia also has a striking mad scene in act 4, including the line "There’s rosemary, that’s for remembrance..." This is one of the most memorable scenes and female roles in Shakespeare.
Gertrude as Hamlet's mother is an important element in the plot, although her character is less well developed than others in the play. Another important character, and one whose murder by Hamlet is a significant plot element, is the unsympathetic Polonius. One could also choose Hamlet's friend Horatio as an important character or the, at times comic, duo of Rosencrantz and Guildenstern.