Ynetnews reported that violators will face a fine of 100,000 NIS (about $26,000) and six months in jail.
The law comes after a recent protest staged by ultra-Orthodox groups, with participants wearing striped uniforms and yellow stars resembling those worn by concentration camp victims during the Holocaust.
Two men were arrested recently for posting a picture online that depicted the Jerusalem police chief in a Nazi SS uniform, the Jerusalem Post reported.
The Justice Ministry opposed the law, saying it would cause harm to freedom of expression.
Celebrity Breakups and divorces of 2014 [PHOTOS]