Well, as a female I would want my boyfriend to tell me.
Sure it will hurt. She will probably yell at you and get really angry. However, the longer you wait to tell her, the more pain it will bring.
If you plan on being with her for a while, it needs to come out someday. If she leaves you for it, you probably deserve it.
I'm sorry but I have no mercy for someone who cheats on their boyfriend/girlfriend. I have a feeling my ex cheated on me and it hurts like hell.
So my advice is tell her and don't ever cheat on anyone again. Take this as a learning experience. A relationship is based on honesty and if you can't be honest, you shouldn't be in a relationship.