Hermit crabs are omnivores, which means they eat both plant and animal matter. They typically feed on a diet of algae, plankton, small fish, and decaying organic matter. In captivity, you can feed them commercial hermit crab food, as well as fresh fruits, vegetables, and small pieces of meat or seafood. It's important to provide a varied diet to ensure they get all the nutrients they need.