Boys and girls are different. It seems so obvious. Yet some medical conditions may cause some of those differences to become confused. And then telling apart boys from girls can prove challenging.

It’s one measure of how complex human biology is.

When it comes to whether someone looks like a boy or girl, hormones clearly run the show. For instance, a newborn girl’s genitals may appear somewhat or totally male if that baby had encountered too much of the hormone testosterone (tess-TOSS-tur-own) in the womb. Similarly, too little of this hormone can impair the development of a boy’s reproductive organs.

Educators and Parents, Sign Up for The Cheat Sheet Weekly updates to help you use Science News for Students in the learning environment Client key* E-mail* Go

But male hormones shape other organ systems as well. These include the kidneys and bladder — but most importantly the brain. At birth and throughout life, for instance, the size and function of certain regions in the brain will differ between males and females.

Testosterone is an androgen, or male sex hormones. So how can it end up in the womb of a woman? She might have become exposed during pregnancy to a medicine containing this hormone. More commonly, genetic changes — called mutations — will tell her fetus to produce too much testosterone or to make this hormone at the wrong time. (Both males and females make the hormone, but in very different amounts). This could trigger a small but critical change in how a girl’s body develops.

When this happens very early in development, a baby may be born with one of several conditions. Collectively, they’re known as differences or disorders of sex development, or DSDs. (There is no scientific evidence showing that DSDs cause or are linked to transgender identity.)

DSDs are rare, notes William Reiner. He is a child and adolescent psychiatrist at the University of Oklahoma Health Sciences Center in Oklahoma City. He is also a pediatric urologist, specializing in diseases affecting the urinary tract and conditions affecting male reproductive organs.

The best studied DSD is something known as congenital adrenal hyperplasia, or CAH. The grape-size adrenal glands manufacture small amounts of testosterone — in everyone. A mutation in genes might instruct these glands to produce an oversupply of androgens. This mutation would not likely affect boys. They already make lots of androgens, so their bodies would hardly notice a little more.

Girls born with CAH, however, can appear masculinized — more boy-like. In some cases, their reproductive anatomy might slightly, or even strongly, resemble a boy’s. Doctors refer to this condition as intersex.

In severe cases, a baby that is genetically a girl may at birth visually appear to be a boy. Babies born with characteristics of both sexes sometimes undergo surgery soon after birth. This would make their genitals look more characteristic of their genetic sex. Other times, doctors and parents together must decide which gender to assign a baby.

Reiner often sees patients who are born with DSDs and have intersex features. He also studies children and teens who transition to a different gender (the opposite of the one they had been assigned at birth, based on their apparent biological sex). Some of these children are transgender. Others may have encountered conditions in the womb that altered how parts of their body (such as the genitals) developed.

Another type of genetic error, or mutation, prevents the body from making an enzyme needed to produce DHT. This hormone is more powerful than testosterone in differentiating the male body. So too little of this enzyme could cause the bodies of male children to appear feminized. That means their genitals may somewhat — or even totally — resemble a girl’s.

What does this all mean? Says Reiner, “You cannot necessarily tell by looking at the genitals whether you’re going to have a child who has a male or a female gender identity.”