Welsh is a surname from the Anglo-Saxon language given to the Celtic Britons. The surname can also be the result of anglicization of the German cognate Welsch.
It appears that the etymology of the name Welsh is derived from the Anglo-Saxon word wilisc meaning 'foreigner', 'stranger', or 'non-Anglo-Saxon'. These terms were used by the ancient Germanic peoples to describe inhabitants of the former Roman Empire over the Alps, Rhine, and North Sea, who were largely romanised and spoke Latin or Celtic languages. The Old High German walh became walch in Middle High German and the adjectival walhisk became MHG welsch. In present day German, Welsche refers to Latin (or Romance) peoples, the Italians in particular, but also the French and the Romanic neighbours of the German-speaking lands in general.
The Anglo-Saxon variant wilisc of the Proto-Germanic root was applied to the native British peoples encountered by the Saxon invaders and settlers during the 5th and 6th centuries AD. Over the succeeding centuries the term wilisc morphed through Middle English into welsh, becoming an epithet at once more specifically for the Welsh people, as England became increasingly populated with Anglo-Saxons, and more generally for numerous types of metaphorical and real 'outsider' in medieval community life. This last point opens up a wide vista of possibilities for the genealogy and origin of the surname 'Welsh' in individual cases, thus bringing into question the easy assumption that an ancestral 'Welsh' was necessarily Celtic or a 'Welshman'.
Fixed family names were adopted in Wales from the 15th century onwards. Until this point, the Welsh had a patronymic naming system.
In 1292, 48 percent of Welsh names were patronymics, and in some parishes over 70 percent. Other names were derived from nicknames, (rarely) occupational names, and a few non-hereditary personal names. Patronymic names changed from generation to generation, with a person's baptismal name being linked by ap, ab (son of) or ferch (daughter of) to the father's baptismal name to perhaps the seventh generation. For example, Evan son of Thomas would be known as Evan (ap) Thomas; Evan's son, John, would be John (ab) Evan; John's son Rees would be Rees (ap) John; and David's son, James, would be James (ap) David.
Patronymics were essentially a genealogical history of the family (or its male line), and names such as Llewelyn ap Dafydd ab Ieuan ap Griffith ap Meredith were not uncommon. The Encyclopedia of Wales surmises that the system arose from Welsh law, which made it essential for people to know how people were descended from an ancestor. These laws were decaying by the later Middle Ages, and the patronymic system was gradually replaced by fixed surnames, although the use of patronymic names continued up until the early 19th century in some rural areas. In the reign of Henry VIII surnames became hereditary amongst the Welsh gentry, and the custom spread slowly amongst commoners. Areas where English influence was strong abandoned patronymics earlier, as did town families and the wealthy.