The city government on February 3 started soliciting opinions for a draft version of the code. There are rules regarding cursing, smoking, spitting, urination, vandalism and wearing skimpy or offensive clothes in public spaces.
It is not immediately clear how these rules will be policed. But the city plans to apply them to all who visit and live there.
Hanoi officials said the code aims to set high ethical standards and help build Hanoi into a "civil and polite" city.
Those complying with the code provisions will be praised while violators will be criticized in the media, they said.
Hanoi has been promoting itself heavily as an attractive destination. Its foreign arrivals increased 23% to more than four million in 2016.
A few weeks ago, Ho Chi Minh City published its own etiquette code for tourists. The code, accompanied with a PSA video, has sparked some controversy and debate online with many critcizing the way foreigners are depicted. Some have argued that it is locals who really need to clean up their acts.