What does Nazi have anything in common with those obsessively correcting other people's grammar? What is the origin of this expression?
A grammar Nazi is someone who corrects another's grammar in a way the accused feels is overly harsh. From the OED:
Nazi n. 2.b. hyperbolically. A person who is perceived to be authoritarian, autocratic, or inflexible; one who seeks to impose his or her views upon others. Usu. derogatory.
Their first citation is for Safety Nazis by P. J. O'Rourke in Inquiry from 1982:
The Safety Nazis advocate gun control, vigorous exercise, and health foods.
The earliest example of grammar Nazi I found was in Usenet group comp.sys.apple2 in January 1991, by "The Unknown User" correcting another's spelling:
Ok, I posted a message on this subject earlier with sort of a "rediculous"
ridiculous. I'm a card carrying member of the Spelling and Grammar Nazis of America.
As Barrie England commented:
Regardless of its orgin, it's an abominable term, which displays both historical insensitivity and linguistic illiteracy.
While I'm not aware of the exact origin (though I suspect Usenet) you should be aware "grammar nazi" while probably most popular, is not the only kind of "X nazi" on the Internet. "Fashion nazi", "Vegan nazi", "Fitness nazi" are all names for people who are obsessively critical about people "violating the rules", including throwing a fit, calling names, and essentially blowing any "violation" far out of proportions.
This is a stronger derivative of "X Police" - e.g, "Fashion Police" - another humorous derogatory term claiming too high interest in "keeping others in line" in given domain they may not care about.
This probably relates to Nazis tending to kill people in occupied for small misdemeanors with impunity - Jews in ghettos could die for unlicensed trade, singing forbidden songs, or staying outside past curfew. So, a person who blows a misdemeanor out of proportions may be compared to a Nazi.