Does your S/O know you masturbate

I do and I am hiding it from my boyfriend and I never told my ex husband I have . I feel ashamed to say I needed pleasure and didn't go to him. Like a guilty feeling so I never opened up about it . Do you hide it from your partner