McLoughlin is one of nearly two dozen Anglicisms for three Gaelic-Irish surnames: Mac/Nic Lochlainn, Ó/Ni Máoilsheáchlainn, and Mac/Nic Lochnaigh. Mac and Ó are masculine prefixes; Ni/Nic is feminine. Mac is rendered into English as Mac, Mc and M'. Ó is rendered O' . The feminine prefix is rendered into English according to its masculine counterpart. They are used with names that originated as patronymics. Occasionally, the prefix Mael/Maol is Anglicised Mac/Mc.
Origins
The surname Mac/Nic Lochlainn originated in Ulster. Lochlann was originally a name for Scandinavia, especially Norway, so called after the fjords - Lochlainn, the adjectival form, literally means "lake-ish" or "full of lakes," a "land of lakes," etc. The Annals of Ulsterrefer to the Vikings as Lochlannach meaning "of Lochlann." Lochlan/Lochlain is still used as a man's personal name in Ireland and Scotland, though not commonly. English forms of the surname Mac/Nic Lochlainn are concentrated in western Ulster, on both sides of the international boundary. But the family are found throughout Ulster, and spread eastward during the Middle Ages, across the North Channel into Scotland where they became the Clan MacLachlan. Spellings of the name peculiar to Scotland include McLachlan, McLachlin, and McLauchlan. The Mac/Nic Lochlainn and their Scottish cousins are descendants of the Northern Uí Néill. The Ó/Ni Máoilsheáchlainn surname originated in Meath. The family claim descent from High KingMáel Sechnaill mac Domnaill of the Southern Uí Néill, relatives of the Northern family. The surname was originally rendered O'Melaghlin in Norman French and Middle English but was corrupted to McLoughlin and M'Loughlin in the 18th century. The Lochnaigh family in Connaught, who claim descent from the Uí Fiachrach dynasty, mostly became Loughney in English but are very occasionally called McLoughlin. They tend to be concentrated in Galway.
Máel Sechnaill mac Domnaill, reigned 980-1002;1014-1022.
The Ó Máoilsheáchlainns of Meath lost their lands and their power in the centuries following the Norman Invasion - their homeland of Meath even losing its status as a kingdom/province and being absorbed into Leinster. The family were recorded as O'Melaghlin, and after the 17th century, McLoughlin.
In Scotland
The Northern Uí Néill family expanded from Ulster into Argyll, in Scotland, where Middle Irish 'Mac/Nic Lochlainn' became Modern Scots Gaelic 'Mac/Nic Lachlainn', most commonly spelled 'MacLachlan in Scots and English. See the Clan MacLachlan article for more information.