The German Strafgesetzbuch (Criminal Code) in § 86a outlaws "use of symbols of unconstitutional organizations" outside of the contexts of "art or science, research or teaching". This concerns Nazi symbolism in particular and is part of the denazification efforts following the fall of the Third Reich.
The law prohibits the distribution or public use of symbols of unconstitutional groups–in particular, flags, insignia, uniforms, slogans and forms of greeting.
The relevant excerpt of the German criminal code reads:
§ 86 StGB Dissemination of Means of Propaganda of Unconstitutional Organizations
(1) Whoever domestically disseminates or produces, stocks, imports or exports or makes publicly accessible through data storage media for dissemination domestically or abroad, means of propaganda:
[…]
shall be punished with imprisonment for not more than three years or a fine. […]
(3) Subsection (1) shall not be applicable if the means of propaganda or the act serves to further civil enlightenment, to avert unconstitutional aims, to promote art or science, research or teaching, reporting about current historical events or similar purposes. […]
§ 86a StGB Use of Symbols of Unconstitutional Organizations
(1) Whoever:
shall be punished with imprisonment for not more than three years or a fine.
(2) Symbols, within the meaning of subsection (1), shall be, in particular, flags, insignia, uniforms, slogans and forms of greeting. Symbols which are so similar as to be mistaken for those named in sentence 1 shall be deemed to be equivalent thereto.
(3) The exceptions from §86 subsection (3) and (4) apply accordingly.
The law text does not name the individual symbols to be outlawed, and there is no official exhaustive list. A symbol may be a flag, emblem, uniform, or a motto or greeting formula. The prohibition is not tied to the symbol itself but to its use in a context suggestive of association with outlawed organizations. Thus, the Swastika is outlawed if used in a context of völkisch ideology, while it is legitimate if used as a symbol of religious faith, particularly any South Eastern or East Asian religions. Similarly, the Wolfsangel is outlawed if used in the context of the Junge Front but not in other contexts such as heraldry, or as the emblem of "landscape poet" Hermann Löns. Due to the law, German Neo-Nazis took to displaying modified symbols similar but not identical with those outlawed. In 1994, such symbols were declared equivalent to the ones they imitate (Verbrechensbekämpfungsgesetz Abs. 2).