Agriculture in Scotland in the early modern era includes all forms of farm production in the modern boundaries of Scotland, between the establishment of the Renaissance in the early sixteenth century and the beginning of the Industrial Revolution in the mid-eighteenth century. This era saw the impact of the Little Ice Age, which peaked towards the end of the seventeenth century. Almost half the years in the second half of the sixteenth century saw local or national scarcity, necessitating the shipping of large quantities of grain from the Baltic. In the early seventeenth century famine was relatively common, but became rarer as the century progressed. The closing decade of the seventeenth century saw a slump, followed by four years of failed harvests, in what is known as the "seven ill years", but these shortages would be the last of their kind.
 As feudal distinctions declined in the early modern era, the barons and tenants-in-chief merged to form a new identifiable group, the lairds. With the yeomen, these heritors were the major landholding orders. Others with property rights included husbandmen and free tenants. Many young people left home to become domestic and agricultural servants. The English invasions of the 1640s had a profound impact on the Scottish economy. Under the Commonwealth, the country was relatively highly taxed, but gained access to English markets. After the Restoration customs duties with England were re-established. Economic conditions were generally favourable, as land owners promoted better tillage and cattle-raising. After the Union of 1707 there was a conscious attempt to improve agriculture among the gentry and nobility. Introductions included the English plough, foreign grasses, rye grass and clover, turnips and cabbages. Lands were enclosed, displacing the run rig system and free pasture. Marshes were drained, lime was put down, roads built, woods planted, drilling and sowing and crop rotation were introduced. The introduction of the potato to Scotland in 1739 greatly improved the diet of the peasantry. The resulting Lowland Clearances saw the eviction of hundreds of thousands of cottars and tenant farmers in central and southern Scotland.
 Scotland is roughly half the size of England and Wales and has approximately the same amount of coastline, but only between a fifth and a sixth of the amount of the arable or good pastoral land, under 60 metres above sea level, and most of this is located in the south and east. The early modern era saw the impact of the Little Ice Age, of colder and wetter weather, which peaked towards the end of the seventeenth century. In 1564 there were thirty-three days of continual frost, with rivers and lochs freezing over. This reduced the altitude at which crops could be grown and shortened the growing season by up to two months in extreme years. One result was the abandonment of marginal land in the sixteenth century, as it became impossible to sustain agriculture, particularly in the uplands, but new settlements were created as a result of the opening up of hunting reserves like Ettrick Forest and less desirable low-lying land was also settled, often incorporating features into their names such as bog, marsh and muir. Almost half the years in the second half of the sixteenth century saw local or national scarcity, necessitating the shipping of large quantities of grain from the Baltic, referred to as Scotland's "emergency granary". This was particularly from Poland through the port of Danzig, but later Königsberg and Riga, shipping Russian grain, and Swedish ports, would become important. The trade was so significant that Scottish colonies were established in these ports.
 While the feudal tenures of barons were increasingly nominal  local tenants-in-chief, who held legally held their land directly from the king and who by the sixteenth century were often the major local landholders in an area, grew in significance. As feudal distinctions declined, the barons and tenants-in-chief merged to form a new identifiable group, the lairds, roughly equivalent to the English gentlemen. Below the lairds were a variety of groups, often ill-defined. These included yeomen, later characterised by Walter Scott as  "bonnet lairds", often owning substantial land. The practice of feuing (by which a tenant paid an entry sum and an annual feu duty, but could pass the land on to their heirs) meant that the number of people holding heritable possession of lands, which had previously been controlled by the church or nobility, expanded. These and the lairds probably numbered about 10,000 by the seventeenth century and became what the government defined as heritors, on whom the financial and legal burdens of local government increasingly fell.
 Below the substantial landholders were those engaged in subsistence agriculture, who made up the majority of the working population. Those with property rights included husbandmen, lesser landholders and free tenants. Below them were the cottars, who often shared rights to common pasture, occupied small portions of land and participated in joint farming as hired labour. Farms also might have grassmen, who had rights only to grazing. By the early modern era in Lowland rural society, as in England, many young people, both male and female, left home to become domestic and agricultural servants. Women acted as an important part of the workforce. As well as moving away from their families as farm servants, married women worked with their husbands around the farm, taking part in all the major agricultural tasks. They had a particular role as shearers in the harvest, forming most of the reaping team of the bandwin.
 Most farming was based on the Lowland fermtoun or Highland baile, settlements of a handful of families that jointly farmed an area. The most common system was based on infield and outfield agriculture. The infield was the best land, close to housing. It was farmed continuously and most intensively, receiving most of the manure. Crops were usually bere (a form of barley), oats and sometimes wheat, rye and legumes. The more extensive outfield was used largely for oats. It was fertilised from the overnight folding of cattle in the summer and was often left fallow to recover its fertility. In fertile regions the infield could be extensive, but in the uplands it might be small, surrounded by large amounts of outfield. In coastal areas fertiliser included seaweed and around the major burghs urban refuse was used. Yields were fairly low, often around three times the quantity of seed sown, although they could reach twice that yield on some infields.
 The area of arable land farmed by a family was notionally suitable for two or three plough teams, allocated in runrigs. Runrigs, were a ridge and furrow pattern, similar to that used in parts of England, with alternating "runs" (furrows) and "rigs" (ridges). They usually ran downhill so that they included both wet and dry land, helping to offset some of the problems of extreme weather conditions. Most ploughing was done with a heavy wooden plough with an iron coulter, pulled by oxen, which were more effective on heavy soils and cheaper to feed than horses. They were usually pulled by a team of eight oxen, which would have taken four men to operate and only covered half an acre a day. In the late sixteenth century population growth in the west Highlands prompted an abandonment of ploughing in favour of more intensive cultivation methods using spades and foot ploughs (cas chrom) with lazy beds, which produced larger furrows with narrower channels between and allowed arable cultivation in locations where ploughing would have been impossible. Pasture was often accessed by shieling-grounds, with shelters made of stone or turf, used for the grazing of cattle in summer. These would often be distant from the main settlements in the Lowlands, but might be relatively close in the more remote Highlands. All farms combined livestock with arable farming, with cattle and sheep and goats in parts of the Highlands and all farms growing some grain. However, there was some specialisation, with arable most important in the East and there was a tradition of sheep farming in the eastern Borders dating back to the arrival of new monastic orders in the twelfth century, which continued after the secularisation of the monasteries.
 In the early seventeenth century famine was relatively common, with four periods of famine prices between 1620 and 1625. The English invasions of the 1640s had a profound impact on the Scottish economy, with the destruction of crops and the disruption of markets resulting in some of the most rapid price rises of the century. Under the Commonwealth, the country was relatively highly taxed, but gained access to English markets. After the Restoration the formal frontier with England was re-established, along with its customs duties. Economic conditions were generally favourable from 1660 to 1688, as land owners promoted better tillage and cattle-raising. Arable farming grew in the Lowlands, particularly around the growing urban centres like Edinburgh. Agricultural improvement began in the late seventeenth century in the Lothians and central Scotland, with the use of lime to combat the acidity of the soil, trees were planted, new crops introduced including sown grass and the rotation of crops. Three acts of parliament passed in 1695 allowed the consolidation of runrigs and the division of commonties and common pasture and small scale enclosures began to be carried out.
 Highlanders had been droving cattle on the hoof to the Lowlands since at least the sixteenth century. By the 1680s the trade had expanded to the larger English markets. Cattle were crossed with larger Irish breeds and large parks were constructed by Galloway landholders to hold and fatten cattle. By the end of the century the drovers roads had become established, stretching down from the Highlands through south-west Scotland to north-east England. From there some were driven to Norfolk to be fattened before being slaughtered in Smithfield for the London population. Specialisation continued, with the increasing commercialisation of sheep farming in the Borders as English markets opened up after the Union of Crowns in 1603 and dairy becoming a feature of farming in the western Lowlands.
 The closing decade of the seventeenth century saw the generally favourable economic conditions that had dominated since the Restoration come to an end. There was a slump in trade with the Baltic and France from 1689 to 1691, caused by French protectionism and changes in the Scottish cattle trade, followed by four years of failed harvests (1695, 1696 and 1698-9), known as the "seven ill years". The result was severe famine and depopulation, particularly in the north. The famines of the 1690s were seen as particularly severe, partly because famine had become relatively rare in the second half of the seventeenth century, with only one year of dearth (in 1674) and the shortages of the 1690s would be the last of their kind.
 Climatic conditions began to improve in the early eighteenth century, although there were still bad years, like that of 1739–41. Increasing contacts with England after the Union of 1707 led to a conscious attempt to improve agriculture among the gentry and nobility. The Society of Improvers was founded in 1723, including in its 300 members dukes, earls, lairds and landlords. Before the eighteenth century English books on husbandry had been available or reprinted in Scotland, but in the eighteenth century there were increasing numbers of titles published by Scottish authors in Scotland. In the first half of the century these changes were limited to tenanted farms in East Lothian and the estates of a few enthusiasts, such as John Cockburn and Archibald Grant. Not all were successful, with Cockburn driving himself into bankruptcy, but the ethos of improvement spread among the landed classes.
 The English plough, rye grass and clover, turnips and cabbages were introduced; lime was put down, marshes were drained, roads built and woods planted. Drilling and sowing and crop rotation were introduced. The introduction of the potato to Scotland in 1739 greatly improved the diet of the peasantry. Enclosures began to displace the runrig system and free pasture, creating the landscape of largely rectangular fields that characterises the Lowland Scottish landscape today. New farm buildings, often based on designs in patterns books, replaced the fermtoun and regional diversity was replaced with a standardisation of building forms. Smaller farms retained the linear outline of the longhouse, with dwelling house, barn and byre in a row, but in larger farms a three- or four-sided layout became common, separating the dwelling house from barns and servants quarters. There were also organisational changes that would have long term consequences, including the commutation of payments in kind for those in money, the granting of longer leases and the consolidation of smaller holdings.
 
Although some estate holders improved the quality of life of their displaced workers, the Agricultural Revolution led directly to what is increasingly becoming known as the Lowland Clearances, when hundreds of thousands of cottars and tenant farmers from central and southern Scotland were evicted from the farms and small holdings their families had occupied for hundreds of years. Many small settlements were dismantled, their occupants moved either to the new purpose-built villages built by the landowners such as John Cockburn's Ormiston or Archibald Grant's Monymusk on the outskirts of the new ranch-style farms, to the new industrial centres of Glasgow, Edinburgh, or northern England. Tens of thousands of others emigrated to Canada or the United States, finding opportunities there to own and farm their own land.