Dirty, filthy, foul, nasty, squalid mean conspicuously unclean or impure.
Dirty is the general term for what is sullied or defiled with dirt of any kind.
Filthy is a much stronger term than dirty in its suggestion of offensiveness; it often suggests gradually accumulated dirt which besmears or begrimes rather than merely soils.
Foul carries a still stronger implication of revolting offensiveness; it often implies an unwholesome or malodorous state resulting from the decay of putrescible matter. It may come near to loathsome or disgusting.
Nasty applies chiefly to what is repugnant to a person who is fastidious about cleanliness.
Sometimes nasty is softened to a mere synonym for “objectionable, disagreeable”.
Squalid adds to the idea of dirtiness or filth that of extreme slovenliness or neglect.
All of these terms may imply moral uncleanness or baseness or obscenity.
Dirty, however, stresses meanness or despicability.
Filthy and foul imply disgusting obscenity, filthy stressing the presence of obscenity and foul, its ugliness.
Nasty implies a peculiarly offensive unpleasantness.
Squalid implies sordidness as well as baseness.
The first four terms are used also of weather, meaning the opposite of clear and thereby implying rainy, snowy, stormy, or foggy weather.