Plankton and Algae
Many marine hermit crabs subsist primarily on a diet of plankton and algae unless something else is available. Smaller crabs have trouble catching anything alive and larger than themselves, so this is their go-to for sustenance. The crabs use their claws to direct things into their mouths while they suck in anything in the area. This is the easiest way to collect plankton in the water and algae stuck to the sides of rocks.
Plants
Marine hermit crabs are fond of eating seaweed and basically any available plant life in the ocean. Plants provide an easy meal because most small crabs are not adept at catching live creatures. The crabs use their claws to pull off leaves or find loose kelp that sits at the bottom of the sea. With their small mouths, they munch at the plants and slowly eat away until they move along to something else.
Dead Animals
Because the hermit crab is a scavenger, it won't hesitate to eat dead animals or animal parts that are decomposing on the ocean floor. Dead fish, sea horses and even other crabs are all possible meals for a hungry hermit crab. Squid and larger fish will sometimes turn up as well. Basically anything you can imagine living and dying in the shallow parts of the ocean is fair game for a hermit crab that crosses its path. They are the vultures of the sea.
Fish and Other Small Sea Creatures
Most hermit crabs are omnivores in the wild, so they're comfortable eating meat or plants. Small fish that frequent the ocean floor might turn up as a hermit crab meal. Hermit crabs aren't terribly adept at catching live creatures but small bottom dwellers like shrimp are generally easy prey. Tube worms and small muscles might also come into the crab's diet depending on the area the crab inhabits.