William Hamilton was educated at Edinburgh and Oxford but, due to the unpopularity of Scots at Oxford, he did not receive a fellowship and returned to Edinburgh. He became the 9th Baronet after a law suit in 1861.
In 1821 Hamilton was appointed professor of civil history at Edinburgh University, where, in 1836, he became professor of logic and metaphysics. Hamilton was one of the first in a series of British logicians to create the algebra of logic and introduced the 'quantification of the predicate'. Boole, De Morgan and Venn followed him. However Hamilton helped begin this development and his work, although not of great depth, influenced Boole to produce a much more sophisticated system.
Hamilton stimulated an interest in metaphysics and introduced Kant and other German philosophers to the British public.