My OH wanted a surprise yet I wanted to know and he knew I wanted (and had) to know.
Prior to setting off for the scan I got a blank postcard and wrote "boy" "girl" "image unclear" "percentage certainty". I put this in an unsealed envelope and when we went in together for the scan, told the sonography "he wants a surprise, I want to know so if you could kindly fill this in then I can open it in my own time".
When it came to the sexing part, the sonographer had a rummage around and then said "Nope, sorry - baby not co-operating today". OH thought this was the best news ever and I was pretty miffed. Until the sonographer handed me the envelope hidden in my notes and gave me a small wink I realised she'd had me fooled.
I kept the surprise of "boy - 99% certainty" - even refusing to tell my OH when I was actually giving birth (much to the amusement of the midwife my "No, I'm nearly finished - wait until then!" comment made her chuckle).
Throughout the pregnancy people kept asking me if I knew, I just told them that "baby had their legs crossed so we couldn't see anything".
This will be the biggest surprise your OH will ever have, there will be no way you'll want to spoil it for him. It just means you need to always refer to the baby as 'baby' and not s/he, and when choosing baby names, pick a good name for the sex you aren't having as just going "yeah, that'll do" for a name you know won't be used is a huge giveaway!