If you want to understand just how miserable a childhood can be, 16-year-old “Jane Doe” is a good place to start.

That’s what the authorities in Connecticut call her to protect her identity. She was removed a few days ago from an adult prison where she had been confined by herself for two months — not as punishment, but because the state said it had nowhere else to put her that would be safe.

Now Jane is in a girls’ detention center in Middletown, Conn. She’s one of almost 70,000 American youths incarcerated on any given day — and a reminder of how ineffective our programs for troubled children are.

Like many detained kids, Jane has been through hell. Because her father was in prison and her mother was a drug abuser, she was raised by relatives. At age 8, she says in an affidavit provided to the courts, her cousin began to rape her anally, causing her to lose control of her bowels.

A history of abuse is common for troubled kids. One study of 2,500 people sentenced to life imprisonment while juveniles found that almost half had been physically abused. Among girls, 77 percent reported sexual abuse. More than 60 percent of incarcerated youths in America are confined for nonviolent offenses. Two-thirds are children of color.

Jane, who is Hispanic, seems to have had little help as a young child, when social services are most effective. But at 12, she says in the affidavit, she was placed by state authorities in a school for troubled youths. Even after coming under state supervision, she recounts repeated sexual abuse by staff, relatives and other youths.

Jane was particularly vulnerable because she is transgender. She was born male but identifies as female. At 15, Jane was living on the streets. A pimp sold her for sex, she says; she eventually escaped but continued to sell sex herself.

She was periodically violent to staff and girls in the youth centers she was sent to, court documents show. Connecticut cited that history of violence, and a need to protect others, in isolating Jane in an adult prison beginning in April.

The larger lesson in Jane’s story is the way we systematically over-rely on the criminal justice toolbox to deal with youths, rather than on social services or education. The United States incarcerates children at a rate that is 10 or 20 times higher than in some other industrial countries.

The cost of detaining a youth is about $100,000 a year. And one study found that the cost to society of a high-risk 14-year-old who doesn’t straighten out is at least $3.2 million over his lifetime.

Thus it would be economically efficient, as well as humane, to invest in interventions from the beginning of life that reduce delinquency. That means home visitation to at-risk families, lead abatement, early education, and schools for low-income children that are as good as those for the middle class.

As a result partly of costs, youth detention rates are dropping since peaking in about 1995. But we still fail systematically to invest adequately in children like Jane, who is a reminder that it’s much easier to help a child at 6 than at 16.

“Everyone thinks I am some kind of wild animal,” she wrote despairingly from prison in May. “If this is helping me, then I’m all set with being helped.”