I haven't told my boyfriend I had a miscarriage.
Is he the one that got you pregnant?
Yes, he would have been the father.
You shouldn't keep something that important secret from your partner.  If he is expecting a child and finds out you had a miscarriage, he would be really upset.  You should tell him about the miscarriage because he is going to find out eventually.
I don't want him to be upset.
I understand, but it's important that you tell him so you two can work through your grief together. It isn't right to go through it alone, and it isn't right to hide something so big from him.