Interestingly, hard-boiled eggs do not keep nearly as long as raw eggs, which can last three to five weeks in the refrigerator. There is a good reason for this. When a hen lays an egg, it puts a naturally protective coating on the outside of the shell.