1786, earlier neger (1568, Scottish and northern England dialect), negar, negur, from French nègre, from Spanish negro (see Negro). From the earliest usage it was "the term that carries with it all the obloquy and contempt and rejection which whites have inflicted on blacks" [cited in Gowers, 1965, probably Harold R. Isaacs]. But as black African inferiority was at one time a near universal assumption in English-speaking lands, the word in some cases could be used without deliberate insult. More sympathetic writers late 18c. and early 19c. seem to have used black (n.) and, after the American Civil War, colored person.
Nigger is more English in form than negro, and was formerly and to some extent still is used without intent; but its use is now confined to colloquial or illiterate speech, in which it generally conveys more or less of contempt. [Century Dictionary, 1895]
"You're a fool nigger, and the worst day's work Pa ever did was to buy you," said Scarlett slowly. ... There, she thought, I've said "nigger" and Mother wouldn't like that at all. [Margaret Mitchell, "Gone With the Wind," 1936]
It was also applied by English colonists to the dark-skinned native peoples in India, Australia, Polynesia.
One hears the contemptuous term "nigger" still applied to natives by those who should know better, especially by youths just come from home, and somewhat intoxicated by sudden power. [Samuel Smith, "India Revisited," in "The Contemporary Review," July 1886]
The reclamation of the word as a neutral or positive term in black culture (not universally regarded as a worthwhile enterprise), often with a suggestion of "soul" or "style," is attested first in the U.S. South, later (1968) in the Northern, urban-based Black Power movement. The variant nigga, attested from 1827 (as niggah from 1835), is found usually in situations where blacks use the word. Also compare nigra.
[F]or when a town black has called a country black (equally black with himself) a "dam black plantation nigga," you may know that he has been terribly provoked, and has now ejected his last drop of gall in that most contemptuous epithet. [The Pamphleteer, vol. XXVIII, No. LVI, 1827]
Used in combinations (such as nigger-brown) since 1840s for various dark brown or black hues or objects; euphemistic substitutions (such as Zulu) began to appear in these senses c. 1917. Brazil nuts were called nigger toes by 1896. Nigger stick "prison guard's baton" is attested by 1971. To work like a nigger "work very hard" is by 1836.
Slang phrase nigger in the woodpile "a concealed motive or unknown factor affecting a situation in an adverse way" [OED] is attested by 1800; Thornton's "American Glossary" (1912) defines it as "A mode of accounting for the disappearance of fuel," hence "an unsolved mystery." Nigger heaven "the top gallery in a (segregated) theater" first attested 1878 in reference to Troy, N.Y. Nigger-shooter "slingshot" is by 1876.