The swastika as etymological origin of a Chinese character for the number ten thousand
At the Tarim basin of China, swastikas were used to symbolize ten thousand. This character later made its way into Chinese characters and evolved into the shape 万, meaning ten thousand. Chinese characters also have another character for ten thousand, 萬, derived from a pictograph of a scorpion. Today, both 万 and 萬 are in use in China and Japan. The simpler one (万) is part of the simplified Chinese character set, while the more complex one (萬) is part of the traditional Chinese character set, even though both have existed since ancient times, and one is not a simplification of the other character. The Japanese name for 卍 is "manji" which literally means "the ten thousand character." It is not only a symbol, but an actual letter in Japan. In China, the clockwise swastika is also used as a letter, and is called wàn (a homophone of "ten thousand").

The swastika as a symbol of religious significance
The origin of the religious symbol (卍) may or may not be the same as the origin of the ten thousand letter (万). The religious symbol was said to have originated as a representation of Vishnu's chest hair, a symbol of Sri, or good luck. Later, it also represented Buddha's chest hair too. While only counter-clockwise swastika is used as a symbol on maps for Japanese Buddhist temples, both rotations are used for designs within the temples.

Design variations
The swastika symbol (both rotations) is encorporated as the central design in several Japanese family crests. There's also a word suavastika, invented by Max Müller, as the name for the counter-clockwise swastika 卍. However, swastika is usually not limited in meaning to the clockwise swastika. Similarly, Chinese and Japanese words for swastika, wàn and manji respectively, do not specify rotation. Popular swastika designs in Japan are the itsutsu-wari and the mitsu-wari manji which defines the width of the arms to be one-fifth or one-third of the side of the whole square.
ITSUTSU-WARI MIGI MANJI

xxxxxxxxx         xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxx         xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxx         xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxx         xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxx         xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxx         xxxxxxxxx
xxxxxxxxx         xxxxxxxxx
xxxxxxxxx         xxxxxxxxx
xxxxxxxxx         xxxxxxxxx
xxxxxxxxx         xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                  xxxxxxxxx         xxxxxxxxx
                  xxxxxxxxx         xxxxxxxxx
                  xxxxxxxxx         xxxxxxxxx
                  xxxxxxxxx         xxxxxxxxx
                  xxxxxxxxx         xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx         xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx         xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx         xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx         xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx         xxxxxxxxx


MITSU-WARI HIDARI MANJI

    XXXXXXXXXXXXXXXXXXXXXXXXXX  XXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXX  XXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXX  XXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXX  XXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXX  XXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXX  XXXXXXXXXXXX
                  XXXXXXXXXXXX  XXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXX  XXXXXXXXXXXX
    XXXXXXXXXXXX  XXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXX  XXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXX  XXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXX  XXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXX  XXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXX  XXXXXXXXXXXXXXXXXXXXXXXXXX
Some Japanese terms that use the kanji 卍:

卍固め (manji gatame) - a type of wrestling move.
卍巴 (manji tomoe) - to mix and swirl somewhat chaotically. Sometimes used do describe how snow falls during a blizzard.
卍手裏剣 (manji shuriken) - a throwing weapon used by ninjas that are shaped like a swastika.
The makers of Pokémon, Nintendo, once had a Pokémon card out with a swastika on the upper left side. This was meant to be sold only domestically. However, through third parties it got over to the USA, where complaints were made to the Anti-Defamation League. After ADL's complaint towards Nintendo, Nintendo halted production of the "swastika cards," despite the fact that it was not intended to convey racist ideology.
Update: According to a December 12, 2003 Reuters article, MS will be issuing a software patch to remove swastika characters from Bookshelf Symbol 7.