The Department of Health said the tests, to begin on Thursday, are meant to identify all cases of infection as early as possible, especially those whose source of transmission is unknown.
Those tested will include people living and working in areas with high risk of infection like factories and industrial parks where foreigners work or live, workers at eateries that serve foreigners and travelers chosen randomly at major bus stations around the city.
The department expects to test around 4,000 people in all.
The focus on foreigners is because Vietnam allows experts and skilled workers to enter, which poses a possible threat of infection spread.
Recently a Japanese who entered Vietnam on January 17 and was quarantined in Ho Chi Minh City before traveling to Hanoi died with Covid-19 at a hotel in Tay Ho District.
The testing will be done in two phases on March 11-12 and 15-19.
In the latest local outbreak that broke out on January 28, there have been 893 cases in 13 cities and provinces, including 35 in Hanoi.
But the capital, HCMC and eight other places have now gone more than three weeks without a new case.