Raw eggs in their shells last about 3 to 5 weeks in a refrigerator set at 40°F (4°C) or colder, according to the USDA Food Safety and Inspection Service. Keep them in the original carton on an inside shelf (not the door), and you can still use them after the carton’s sell-by date if they have been kept cold. Hard-cooked eggs keep only about 1 week refrigerated; do not leave raw eggs out more than 2 hours.