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:
Their first citation is for Safety Nazis by P. J. O'Rourke in Inquiry from 1982:
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:
As Barrie England commented:
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.