The office of Public Analyst was established by the Adulteration of Food and Drink Act 1860 (23 & 24 Vict. c. 84), the first three appointments being in London, Birmingham and Dublin. The first Scottish analyst was Henry Littlejohn in Edinburgh in 1862, who, with a strong medicinal background and brilliant mind, established many of the critical foundations of public analysis. The Sale of Food and Drugs Act 1875 (38 & 39 Vict. c. 63) made food analysis compulsory and the Sale of Food and Drugs Act 1899 (62 & 63 Vict. c. 51) extended its scope.  Sampling officers generally operated through local public health or sanitary committees.  By 1894 there were 99 public analysts overseeing 237 English and Welsh districts. The City of London Corporation had three food inspectors and a wharf and warehouse inspector in 1908.  Bradford employed an inspector who made 756 visits to fish and chip shops in 1915. In the 1930s the staff in Birmingham comprised three qualified assistants, a clerk and a laboratory attendant.
The Nuisances Removal Act for England 1855 (18 & 19 Vict. c. 121) and the Public Health Act 1875 (38 & 39 Vict. c. 55) gave authority for taking food samples "at all reasonable times". Inspectors, police constables and samplers were responsible for taking food samples, which were divided into three parts, for the vendors, the inspectors and the analysts and sealed into bottles.  Food systems were engineered to allow inspection through portals, manholes and windows.  Prosecution was not common though fines and prison sentences were not unknown.  Adulteration rates fell from 13.8% of samples in 1879 to 4.8% in 1930. Inspectors were empowered to follow milk to sources outside their formal jurisdiction in checking for infection with tuberculosis.  Sanitary authorities were required to register all dairies and enforce cleanliness regulations.
The Manchester Corporation (General Powers) Act 1899 (62 & 63 Vict. c. clxxxviii), as amended in 1904, contained what were known as `milk clauses', which empowered officials to prosecute anyone who knowingly sold milk from cows with tuberculosis of the udder, to demand the isolation of infected cows and notification of any cow exhibiting signs of tuberculosis of the udder and to inspect the cows  and take samples from herds which supplied milk to the city. By 1910 these provisions had been copied by  67 boroughs and 24 urban districts .
The Society of Public Analysts was established in 1874, later becoming the Society for Analytical Chemistry and joining with other societies to form the Royal Society of Chemistry in 1980.
Since the separation of the UK and Ireland, the function of the Public Analyst operates under different legislation, but the term and general duties are the same.  The original work was chemical testing, and this is still a major part, but nowadays microbiological examination of food is an important activity, particularly in Scotland, where Public Analyst laboratories also carry out a statutory Food Examiner role.