12 weeks + 4 days due to generic testing.
Mine was with 1st trimester screening due to type 2 diabetes and advanced maternal age.
I did the 3d ultrasound at 15 weeks and find out it's a boy! The 20 week ultrasound confined it. The 3d was done by a third party and was nice because you got a much better view of the baby, want to go back now that I am nearing my third trimester...
I found out at 14 weeks as a result of genetic testing as well. Greater than 99% chance it's a boy! 20 wk ultrasound confirmed it.
I'll know next week at 13 weeks when I get the results of the genetic prenatal blood work. My other 2 kids I found out around 20 weeks with the anatomy scan.
Depending on your age, you may be offered a genetic test. We chose to do it at 14 weeks and found out we have a girl. Otherwise, the scan is usually done between 18 and 20 weeks. About the earliest the results are trustworthy via sonogram are 16 weeks. Even then, the genitals can still be swollen and you get a false result.