Iran is a country with a dress code and respecting Islamic rules including “Hijab” or the Islamic dress-code is a necessity in Iran. However such rules are not observed strictly, especially for tourists and foreigners.

Men
Shorts are not acceptable in public places.
Wearing ties or bows is not a problem.
T-shirts are acceptable

Women
Obeying Islamic rules including Hijab or Islamic dress-code is necessary in Iran. However, these rules are not observed very strict, especially for tourists and foreigners. You must not worry about maintaining your Hijab, since in times you have forgotten about it, the maximum penalty will be a request (usually in a kind way) to make it correct.

There are some minimum requirements for foreign women dress-code in public places :
1. Color: It’s a completely false belief that wearing must be dark in Iran. There is no limitation in this respect and we recommend you make sure using light colors in summer.
2. Head: Hair should be covered. It does not mean you shall have a tight scarf around your head. Don’t worry, It is very usual that some parts remain out of the cover. It’s quite acceptable for women to allow whips of their hair to frame their face. Appropriate hats & caps can do this function as well as scarves. Scarf is the most common covering for head and is called “Roosari” in Farsi.
3. Body: Should be covered with loose clothes like man shirt, coat or manteau. Arms should not be bare.