If a big tapeworm dies inside your body how come it doesn't go bad and poison you?

Where do these things hang out anyway? How does the body get rid of them without harm, or the thing rotting and making you sick?

Tapeworms hang out in your small intestine. When they die, they come out with your stool.

They live in your intestines. They’re segmented, and as they grow, the terminal segments drop off one by one and pass through your system.

Just a WAG, but if a tapeworm died for whatever reason, the segments would separate and pass out of you. The head might remain attached, but that’s small enough that it wouldn’t cause any real problems. It’d probably just get digested.

They like in the intestines, to which they attach with hooks on their head. Once they die they can no longer hold on and are excreted.

Isn’t there some sort of worm in Africa that can poison you if it dies? I’ve read about natives having to carefully wind it about a stick to get it out (from where I can’t remember). But I’m not entirely sure if this is an apocryphal story or not. RIng any bells?

Ick, I found it. It’s the Guinea Work and it’s a real thing. (I need a pukey smiley)

Guinea worm, which lives under the skin, usually of the legs.

Dude, when you eat ANYthing, it’s dead. Why doesn’t it rot and poison you? To start with, “rot” refers to the result of bacteria or mold on organic matter. We seldom have these bacteria or fungi inside us. And rotting does take time, and usually air - neither of which is in great supply as the alimentary canal moves stuff along at a pretty good clip. Croaked parasites that had been hiding out in other parts of the body get attacked by the immune system and body chemistry pretty readily.

There are probbaly more of those bacteria inside us than anywhere else on the planet. Our guts are cram packed with the little blighters. For that reason food will indeed rot inside a person if it’s allowed to remain there for long enough. As you note food normally moves through fast enought that bacterial decay is fairly insignificant but it does still decay slightly of course, which is why the bacteria can live there in such huge numbers.

Oh, there are plenty of bacteria that can rot things anaerobically. Some of them are in your intestines at all times, doing things like turning beans into CO, methane, and sulfide gasses.