Your baby’s sex is determined at conception when the sperm fertilizes the egg. If you’re having in vitro fertilization (IVF), you may have the option to know the sex of your embryo before it’s implanted. But if you conceived naturally, you’ll have several opportunities to learn whether you’re carrying a boy or girl during your pregnancy. Your doctor will order various tests to check your baby’s health in the first or second trimester of pregnancy. Most of these tests can also accurately determine your baby’s sex. If you want to know, you can ask your doctor when they receive the test results. You should also let your health care provider know if you prefer to wait until your baby is born. Otherwise, they might accidentally reveal the sex and spoil your surprise.