Im not a Dr but something Ive always been asked when my cat has this lol is "Is it fresh or is it old blood". If its fresh then its probably constipation, if its old then you should see your doctor (or vet in my cats case lol). I know you're human but I'm thinking it's pretty much the same as animals.
Of course as I said I'm not a Dr but that's the rules I've always gone by with myself.
if the blood is bright red then it is probably internal hemrroids take stool softners