(By Sarah McBride, Reuters) – Computer science has for the first time become the most popular major for female students at Stanford University, a hopeful sign for those trying to build up the thin ranks of women in the technology field.

Based on preliminary declarations by upper-class students, about 214 women are majoring in computer science, accounting for about 30 percent of majors in that department, the California-based university told Reuters on Friday.

Human biology, which had been the most popular major for women, slipped to second place with 208.

If more women majored in technological fields like computer science, advocates say, that could help alleviate the dearth of women in engineering and related professions, where many practitioners draw on computer science backgrounds.

“We’ve crossed that threshold where women feel supported and comfortable,” said Eric Roberts, a Stanford professor emeritus of computer science who first obtained the numbers. “What we need to do is not turn anyone away because they feel unsupported, and a vibrant core community with a critical mass is essential.”

The shift at Stanford is particularly important given its prominence in Silicon Valley and the large number of companies, including Yahoo and Google, founded by its students.

Only 27 percent of entrepreneurs are women, said Ross Levine, a professor at the University of California, Berkeley, who is researching the gender gap in entrepreneurship.

Computer science is Stanford’s most popular major and has been for several years, according to a spokesman, representing about 20 percent of students with declared majors.

Women make up 49 percent of Stanford’s undergraduate body of about 7,000 students, according to the university.

It was unclear if Stanford is the only major U.S. university where computer science is the top major for female students.

At Harvey Mudd College in southern California, often praised for its high percentages of technical women graduates, computer science is the second-most popular major for women after engineering, a spokeswoman said.

Adding in two other majors that combine computer science with math or computational biology, computer science leads, she said.

Although women earn 57 percent of all bachelor’s degrees, according to the National Science Foundation, only about 18 percent of all U.S. undergraduate computer science degrees go to women.

(Reporting by Sarah McBride in San Francisco. Additional reporting by Jim Finkle in Boston; Editing by David Gregorio)