SAN FRANCISCO -- In a compact studio apartment on the fringes of the Castro district a young couple live with their 7-year-old, whom they dote on and take everywhere: a Scottish terrier named Olive.

Raising children is on the agenda for Daisy Yeung, a high school science teacher, and Slin Lee, a software engineer. But just not in San Francisco.

"When we imagine having kids, we think of somewhere else," Lee said. "It's starting to feel like a no-kids type of city."

A few generations ago, before the technology boom transformed San Francisco and sent housing costs soaring, the city was alive with children and families. Today it has the lowest percentage of children of any of the largest 100 cities in the United States, according to census data, causing some in San Francisco to raise an alarm.

"Everybody talks about children being our future," said Norman Yee, a member of San Francisco's Board of Supervisors. "If you have no children around, what's our future?"

While San Francisco's population has risen to historic highs, the share of children in San Francisco fell to 13 percent, low even compared with New York, with 21 percent. In Chicago, 23 percent of the population is younger than 18, which is also the overall average across the United States.

California, which has one of the world's 10 largest economies, recently released data showing its birthrate is the lowest it's been since the Great Depression.

As San Francisco moves toward becoming a tech-industry town, the lack of children is one more change that raises questions about its character. Are fewer children making San Francisco more one-dimensional and less vibrant? The answer is subjective and part of an impassioned debate over whether a new, wealthier San Francisco can retain the allure of the city it is replacing.

Many immigrant and other residential areas of San Francisco still have their share of the very young and the very old. The sidewalks of some wealthy enclaves even have stroller gridlock on weekends. But in the growing number of neighborhoods where employees of Google, Twitter and so many other technology companies live or work, the sidewalks display a narrow band of humanity, as if life started at 22 and ended somewhere around 40.

"Sometimes I'll be walking through the city and I'll see a child and think, 'Hey, wait a second. What are you doing here?'" said Courtney Nam, who works downtown at a tech startup. "You don't really see that many kids."

San Francisco, population 865,000, has roughly the same number of dogs as children: 120,000.

In an interview last year, Peter Thiel, the billionaire Silicon Valley investor and a co-founder of PayPal, described San Francisco as "structurally hostile to families."

Housing costs are not the only reason there are relatively few children. A public school system of uneven quality and the large number of gay people, many of them childless, have all played roles in the decline in the number of children, which began in the 1970s. The tech boom reinforces the notion that San Francisco is a place for the young, single and rich.

"If you get to the age that you're going to have kids in San Francisco and you haven't made your million -- or more -- you probably begin to think you have to leave," said Richard Florida, an expert in urban demographics and author of The Rise of the Creative Class.

A few recent initiatives have sought to make the city friendlier to families. San Francisco is the first city in the United States to require employers to offer six weeks of fully paid leave for new parents, a law that went into effect this month.

The city also has invested millions in upgrading parks, according to Phil Ginsburg, general manager of the city's Recreation and Parks Department.

"We are trying to do our part to send a very strong message that San Francisco is an awesome place for kids," Ginsburg said. The city has increased its offerings for summer programs, many of which were fully enrolled last summer.

Those who make it work in San Francisco speak of the compromises.

Jean Covington, a San Francisco resident who works as a public defender in Contra Costa County, said she was confronted with what she described as a bewildering public school selection system governed by an algorithm that determines where children in the city are placed -- sometimes miles from home.

When her daughter turned 5, Covington applied to 14 public kindergartens, but her child ended up being placed in one she didn't choose. She chose a private school instead.

"Everyone starts off with the same dreams: 'I'm going to make it work in the city, and I'm going to be the family that sticks it out,'" Covington said of her friends. "And suddenly the one bathroom in their flat becomes two or three too few. And the school system is too daunting."

San Francisco's public school system has around 53,000 students, a sharp drop from 90,000 in 1970.

The decline is a reflection of families leaving the city and wealthier parents sending their children to private schools. Around 30 percent of San Francisco children attend private schools, the highest rate among large U.S. cities.

Lee, the software engineer, said he loved San Francisco -- the weather, the food, the friends he has made. But the city, he said, feels somewhat detached from the life cycle.

"It's similar to when you go to college and you are surrounded by people who are in the same life stage or who have the same attitude about what their priorities are," Lee said. "That's all you see: people who are exactly like you."

A Section on 01/22/2017