I'm pretty much positive I'm not the first or only person to notice the similarities between these plays, but I definitely couldn't pass up a chance to talk about something that jumped out at me as I read Julius Caesar. In fact, if you read my summaries of Act II, scenes 1 and 2, Act IV, scene 1, and Act V, scene 5, I've already flagged some of them. It's not just the similarities in the natures of some of the characters - for instance, Brutus is extremely noble, as is Hamlet. There are some factual similarities, too: Both talk to ghosts. Both suffer the loss of their female love interests. Both are seeking to bring down someone who has wrongfully taken power. Both are recognized as extremely worthy, noble men at the close of the plays in remarkably similar terms.
I assure you that this post is based on my personal observations and thoughts - I didn't manage to quickly find an essay on this topic. So you will forgive the lack of actual scholarliness, I hope.
In addition to factual points of comparison, the plays share similar language in places. One of the most memorable lines in all of literature comes from Hamlet: "To be or not to be, that is the question." That line is so memorable because it kicks off Hamlet's second soliloquy, in which he again considers killing himself (as he did in his first soliloquy). In Julius Caesar, we have Brutus pondering a different sort of quandary. He's wondering whether Julius will be a good leader, and he says "How that might change his nature, there's the question." Now, it's possible that the "To be or not to be" line wasn't as iconic in Shakespeare's time as it now is. And it's possible that Julius Caesar came before the final version of Hamlet, although likely that it came after the first version (sometimes referred to as Ur-Hamlet). Julius Caesar is believed to have been written around 1599. The "final" version of Hamlet was written between 1599 and 1601 (so, possibly at the same time as JC), though it's widely believed that an earlier version of the play existed as much as a decade earlier.
Which line came first? Shakespeare knows, but he's not saying. Still, the similarity is striking. But when it comes to comparing these plays, it's not just this line from JC, Act II, sc. 1 and the one from Hamlet, Act III, sc. 1, that are similar.
There are other similar lines - as when characters in both plays make references to smiling villains (Hamlet in Hamlet, Act I, sc. 5 and Octavius in Julius Caesar, Act II, sc. 2), both have references to defying augury/ignoring portents (Hamlet in Hamlet, Act V, sc. 2, and Caesar in Act II, sc. 2), and the closings of both plays sound remarkably similar (Hamlet, Act V, sc. 2 and Julius Caesar, Act V, sc. 5).
And there are some similarities between the characters of Hamlet and Brutus. Hamlet spends a lot of time thinking about suicide, as we can tell from his first soliloquy ("O that this too, too solid/sullied flesh would melt"), which dealt with suicide, and his second ("To be or not to be"). Similarly, Brutus mentions the idea of killing himself early on in the play, as a noble way of avoiding improper servitude or submission to an unworthy ruler.
Between their discussions of death and the general set-up, it's pretty clear from early in both plays that Hamlet and Brutus are probably going to end up dead, in part because both of them embrace the notion so fully. Hamlet would prefer death because he is so distraught over his father's death (and then all the subsequent turns of event that make continued survival such a living hell - like knowing that his mother and uncle were adulterers, and that his uncle offed his dad, and that he killed Polonius by mistake and that Ophelia is now also dead through a suspicious accidental death/possible suicide); Brutus would welcome death as an honor under a number of circumstances - being killed in battle (very Viking-like, no?) or at his own hand under a few different circumstances (one of which comes to pass). He has killed Caesar, a man he actually respected and liked, for the good of Rome, only to find that perhaps he was in error, and his wife, Portia, has actually killed herself by swallowing fire.
There is a fitting and somewhat ironic mirror-image at work between the plays as well. Throughout his play, Prince Hamlet talks about offing himself, only to die in a battle of sorts (the duel with Laertes, in which he is also opposed by Claudius). Meanwhile, Brutus actually goes into battle against others, but eventually kills himself by impaling himself on his own sword in a sort of assisted suicide. (And yes, I called it "self-inflicted shish-kebabery" in my summary of Act V of the play.)
I can't help but notice that Julius Caesar has more than a few similarities to Macbeth as well (written after both of the plays discussed today), but that will be a topic for another post.