Historical linguists who specialize in Japanese agree that it is one of the two members of the Japonic language family, the other member being Ryukyuan. (An older view, still held by many non-specialists, is that Japanese is a language isolate, of which the Ryukyuan languages are dialects.)
The genetic affiliation of the Japonic family is uncertain. Numerous theories have been proposed, relating it to a wide variety of other languages and families, including extinct languages spoken by historic cultures of the Korean peninsula; the Korean language; the Altaic languages; and the Austronesian languages, among many others. It is also often suggested that it may be a creole language combining more than one of these. The various theories are detailed in the main article. At this point, no one theory is generally accepted as correct, and the issue is likely to remain controversial.
Although Japanese is spoken almost exclusively in Japan, it has been and is still sometimes spoken elsewhere. When Japan occupied Korea, Taiwan, parts of the Chinese mainland, and various Pacific islands, locals in those countries were forced to learn Japanese in empire-building programmes. As a result, there are still many people in these countries who speak Japanese instead of or in addition to the local languages. Japanese emigrant communities (the largest of which are to be found in Brazil) frequently employ Japanese as their primary language. In addition to Brazil, Japanese emigrants are also to be found in large numbers in Peru, Australia (especially Sydney, Brisbane, and Melbourne), and the United States (notably California and Hawaii).
Dozens of dialects are spoken in Japan. The profusion is due to many factors, including the length of time the archipelago has been inhabited, its mountainous island terrain, and Japan's long history of both external and internal isolation. Dialects typically differ in terms of pitch accent, inflectional morphology, vocabulary, and particle usage. Some even differ in vowel and consonant inventories, although this is uncommon.
The main distinction in Japanese dialects is between Tokyo-type and Western-type, though Kyushu-type dialects form a smaller third group. Within each type are several subdivisions. The Western-type dialects are actually in the central region, with borders roughly formed by Toyama, Kyoto, Hyogo, and Mie Prefectures; most Shikoku dialects are also Western-type. Dialects further west are actually of the Tokyo type. The final category of dialects are those that are descended from the Eastern dialect of Old Japanese; these dialects are spoken in Hachijojima, Tosa, and a very few other locations.