BEIJING — I RECENTLY found myself hauling a bag filled with 12 boxes of milk powder and a cardboard container with two sets of air filters through San Francisco International Airport. I was heading to my home in Beijing at the end of a work trip, bringing back what have become two of the most sought-after items among parents here, and which were desperately needed in my own household.

China is the world’s second largest economy, but the enormous costs of its growth are becoming apparent. Residents of its boom cities and a growing number of rural regions question the safety of the air they breathe, the water they drink and the food they eat. It is as if they were living in the Chinese equivalent of the Chernobyl or Fukushima nuclear disaster areas.

Before this assignment, I spent three and a half years reporting in Iraq, where foreign correspondents talked endlessly of the variety of ways in which one could die — car bombs, firefights, being abducted and then beheaded. I survived those threats, only now to find myself wondering: Is China doing irreparable harm to me and my family?

The environmental hazards here are legion, and the consequences might not manifest themselves for years or even decades. The risks are magnified for young children. Expatriate workers confronted with the decision of whether to live in Beijing weigh these factors, perhaps more than at any time in recent decades. But for now, a correspondent’s job in China is still rewarding, and so I am toughing it out a while longer. So is my wife, Tini, who has worked for more than a dozen years as a journalist in Asia and has studied Chinese. That means we are subjecting our 9-month-old daughter to the same risks that are striking fear into residents of cities across northern China, and grappling with the guilt of doing so.

Like them, we take precautions. Here in Beijing, high-tech air purifiers are as coveted as luxury sedans. Soon after I was posted to Beijing, in 2008, I set up a couple of European-made air purifiers used by previous correspondents. In early April, I took out one of the filters for the first time to check it: the layer of dust was as thick as moss on a forest floor. It nauseated me. I ordered two new sets of filters to be picked up in San Francisco; those products are much cheaper in the United States. My colleague Amy told me that during the Lunar New Year in February, a family friend brought over a 35-pound purifier from California for her husband, a Chinese-American who had been posted to the Beijing office of a large American technology company. Before getting the purifier, the husband had considered moving to Suzhou, a smaller city lined with canals, because he could no longer tolerate the pollution in Beijing.

Every morning, when I roll out of bed, I check an app on my cellphone that tells me the air quality index as measured by the United States Embassy, whose monitoring device is near my home. I want to see whether I need to turn on the purifiers and whether my wife and I can take our daughter outside.

Most days, she ends up housebound. Statistics released Wednesday by the Ministry of Environmental Protection revealed that air quality in Beijing was deemed unsafe for more than 60 percent of the days in the first half of 2013. The national average was also dismal: it failed to meet the safety standard in nearly half the days of the same six-month period. The environment minister, Zhou Shengxian, told People’s Daily, the Communist Party mouthpiece, that “China’s air quality is grim, and the amount of pollution emissions far exceeds the environment’s capacity.”

I want my daughter to grow up appreciating the outdoors — sunsets and birdcalls and the smell of grass or the shape of clouds. That will be impossible if we live for many more years in Beijing. Even with my adult-size lungs, I limit my time outdoors. Though I ran on the banks of the Tigris River while in Baghdad and competed in two marathons before moving to China, I am hesitant about doing long-distance training for that kind of race here.

One thing I refuse to forgo is biking, even if it means greater exposure to hazardous air than commuting by car or subway. Given the horrendous traffic here — itself a major contributor to the pollution — I go to the office and restaurants and my courtyard home in Beijing’s alleys on two wheels. This winter, I bought a British-made face mask after levels of fine particulate matter hit a record high in January in some areas — 40 times the exposure limit recommended by the World Health Organization. Foreigners called it the “airpocalypse,” and a growing number are leaving China because of the smog or demanding hardship pay from their employers.

One American doctor here has procured a mask for his infant son. My mask of sleek black fabric and plastic knobs makes me look like an Asian Darth Vader. Better that, though, than losing years of my life.

THIS spring, new data released from the 2010 Global Burden of Disease Study, first published in The Lancet, revealed that China’s outdoor pollution contributed to 1.2 million premature deaths in 2010, or 40 percent of the worldwide total. Another study, published by a prominent American science journal in July, found that northern Chinese lived five fewer years on average than their southern counterparts because of the widespread use of coal in the north.

Cancer rates are surging in China, and even the state news media are examining the relation between that and air pollution. Meanwhile, studies both in and outside of China have shown that children with prenatal exposure to high levels of air pollutants exhibit signs of slower mental development and of behavior disorders. Research from Los Angeles shows that children in polluted environments are also at risk for permanent lung damage.

In northern China, shades of gray distinguish one day from another. My wife and I sometimes choose our vacation destinations based on how much blue we can expect to see — thus a recent trip to Tuscany and the Amalfi Coast. I will never take such skies for granted again. “We still can’t get over how blue the skies are here,” the wife of an American diplomat told me over dinner in Georgetown more than half a year after the couple had moved back to Washington from Beijing.

Food safety is the other issue weighing on us. We have heard the stories of rat meat being passed off as lamb at hotpot restaurants, cooking oil being recycled and crops being grown in soil polluted by heavy metals or wastewater from factories. The food catastrophe that most frightened both Chinese and foreign parents was the milk scandal of 2008, in which six babies died and at least 300,000 children fell ill after drinking milk products tainted with melamine, a toxic chemical. Since then, many parents of newborns have gone to great lengths to bring into China foreign-made infant milk powder when it is needed to supplement breast-feeding.

Months after my trip back from San Francisco, my wife and I realized that our supply of formula was dwindling. We sent e-mails to friends we thought might be traveling soon to China, asking for volunteers to be “mules.” Our friend Alexa flew in from New York this week with two boxes of powder. We have two other friends who promise to bring more this summer.

I recently spoke to a woman in Beijing, Zhao Jun, who pays Chinese students and housewives living in Europe to mail her cans of Cow & Gate, a British brand. “We’re constantly worried, so we want to find a good brand from overseas with a long history,” she said.

So widespread is the phenomenon of Chinese buying milk powder abroad that it has led to shortages in at least a half-dozen countries. Hong Kong has even cracked down on what customs officials call “syndicates” smuggling foreign-made powder to mainland China.

The anxieties do not end with milk. Our daughter has begun eating solids, so that means many more questions for us about how we source our food. Do we continue buying fruits and vegetables from the small shops in the alleys around our home? Do we buy from more expensive stores aimed at foreigners and wealthier Chinese? Do we buy from local organic farms? Last weekend, I went with a friend to visit a village home an hour’s drive northeast of Beijing. He and his wife wanted to lease it as a weekend house, but I was more interested in gauging whether I could use the garden to grow our own vegetables. Some people I know here have done that.

“It’s so difficult to protect yourself on the food issue,” said Li Bo, a proponent of communal gardening and a board member of Friends of Nature, an environmental advocacy group. “I never thought I would become a vegetarian. Then in 2011, I said enough of meat, after so many examples of wrongdoing in animal husbandry.”

Each day that passes in Beijing makes it harder to discern the fine line between paranoia and precaution. Six years ago, when I was back in my hometown Alexandria, Va., to pack for my move to China, my mother handed me several tubes of toothpaste. She had read stories that summer of toxic toothpaste made in China. I felt as if I was going off to college for my freshman year all over again. I put the tubes back in my parents’ bathroom. When I go home these days, my mother still on occasion gives me toothpaste to bring back to Beijing, and I no longer hesitate to pack it in my bag.

Edward Wong is a correspondent in China for The New York Times.

A version of this news analysis appears in print on August 4, 2013, on Page SR1 of the New York edition with the headline: Life In A Toxic Country. Order Reprints|Today's Paper|Subscribe