Kathleen McKinnon always planned to start a family, but it proved to be harder than she imagined.
But her company, like many others in the Bay Area tech community, subsidizes costly assisted-reproduction techniques, including in vitro fertilization (IVF), for families like McKinnon's. In 2017, after two failed attempts, she was thrilled to learn that the procedure was successful, and she had six healthy embryos.
After the procedure, McKinnon's doctors performed an extra screening step that has become increasingly popular in recent years to look for health issues and other factors. During that process, she learned the sex of the embryos based on their chromosomal makeup — XX for female, XY for male. The doctors asked her if she wanted to select a baby with a particular gender.
After some consideration, she and her husband asked their doctors to transfer the one that had the best chance of creating a successful pregnancy. It turned out to be a girl, and their daughter was born in June.
McKinnon knows she has five healthy embryos left: Three males and two females. Next time, she is planning for a boy.
While McKinnon underwent IVF only after failing to get pregnant in other ways, some people are using the technique specifically to try for a baby of one gender.
Fertility clinics are popping up across the country that advertise gender selection, and are charging up to $20,000. CNBC visited one of these clinics, the Fertility Institutes in Encino, California, to meet with well-known IVF specialist Dr. Jeffrey Steinberg.
About 85 percent of Steinberg's patients come to him so they can choose the sex of their baby, he said. It is among the better-known clinics in the world for a gender selection technique, known as preimplantation genetic diagnosis (PGD), the additional screening that is offered with IVF.
Some families are coming to him because they already have multiple children of the same gender. That's known in some circles as "family balancing." But that's not always the case. Some families want only one child with a specific gender, or have an order in mind. Others have medical reasons for wanting a boy or a girl, like a genetic disease that only affects one sex and not the other.
"The bulk of the patients that we see are doing in vitro fertilization only to choose the gender," he said. "We do not require people to have a first baby in order to request the gender on the second baby."
For those who can't afford Steinberg's prices, some clinics offer a cheaper option known as as "sperm sorting", where female and male sperm are separated before insemination. This process sorts the dense X-sperm from the lighter Y-sperm.
Steinberg says in his experience, the accuracy for sperm sorting is about 78 to 80 percent for females and 55 percent to 60 percent for males. His approach might be more expensive, but it is also a lot more accurate.
Bio-ethicists are concerned that this practice is the beginning of a slippery slope leading to the so-called "designer baby," where parents would be able to select from a checklist of traits they want their children to have.
Adding fuel to that debate, Steinberg's clinic is starting to market cosmetic traits like eye color to parents. In the future, it might be possible to predict certain behaviors, although with far less accuracy than gender, as thousands of genes are involved in things like intelligence or athletic ability.
Other experts, like Stanford Law School's Hank Greely, who has studied IVF, don't buy into this argument. Just because a family wants to transfer an embryo of a specific gender, that doesn't mean they're more likely to want to select other traits like eye color.
He also points out that it's not going to become mainstream. "There is still that ceiling with only 180,000 or so people going through IVF in any given year in the United States, and four million babies born," he said. "It's not going to be close to a majority of babies anytime soon."
For her part, McKinnon is skeptical that many women would get IVF just to choose the gender of their baby. For her, it was a byproduct of an expensive and invasive procedure that she tried after struggling to get pregnant for years. And she couldn't choose the sex if the procedure hadn't resulted in both male and female embryos.
"It was such a hard and long and laboring process to even get to the point of being pregnant," she explained. "I can't imagine that somebody would go into a clinic and just be able to physically get pregnant on their own, but want to do it just so they can choose a gender."