Making it clear that you know you have hurt someone goes a long way towards getting your appology accross.
Avoid excuses - anything like "I didn't mean it ..." sounds more like you are excusing yourself because you feel bad (it's a given that you do) rather than making the hurt person feel that you are making ammends.
Finish your apology with something like "Even though I did not mean to hurt you doesn't alter the fact that I did, and for that I am truly sorry, and I hope we can move on from this."
That covers both the fact that you have caused some pain, and that even though you did it without malice, doesn't negate the damage, and you acknowledge that, and wish to say you are sorry.
As advised, don't make a drama out of it - if the person wants to forgive you they will, if not, then take away the lesson - no experience is ever without value.
Good luck.