From the Wikipedia page 
The cantons of France are territorial subdivisions of the French Republic's arrondissements and departments.
Apart from their role as organizational units in certain aspects of the administration of public services and justice, the chief purpose of the cantons today is to serve as constituencies for the election of the members of the representative assembly (General Council) in each department. For this reason, such elections are known in France as "cantonal elections".
As of 2015, there are 2,054 cantons in France. Most of them group together some communes (the lowest administrative division of the French Republic), although larger communes may comprise several cantons, since the cantons are intended to be roughly equal in population – unlike the communes, which range from more than two million inhabitants (Paris) to just one person (Rochefourchat).
The role of the canton is, essentially, to provide a framework for departmental elections. Each canton elects a woman and a man to represent it at the conseil général du département – or general council for the department, which is the principal administrative division of the French Republic.
In urban areas, a single commune generally includes several cantons. Conversely, in rural areas, a canton may comprise several smaller communes. In the latter case, administrative services, the gendarmerie headquarters for example, are often situated in the principal town (chef-lieu) of the canton, although there are exceptions, such as cantons Gaillon-Campagne and Sarreguemines-Campagne, which have in common a "chief-town" which does not belong to either canton.
For statistical (INSEE) purposes, the twenty arrondissements of Paris – the administrative subdivisions of that city – are sometimes considered cantons, but they serve no greater electoral function.
Cantons also form legal districts, as seats of Tribunaux d'instance or "Courts of First Instance" (also, "TI"...). Historically, the cantons are called justices de paix or "district courts".
The cantons were created in 1790 at the same time as the départements by the Revolutionary Committee for the Division of Territory (Comité de division). They were more numerous than today (between 40 and 60 to each département). Cantons were, at first, grouped into what were called districts. After the abolition of the district in 1800, they were reorganized by the Consulate into arrondissements. The number of cantons was then drastically reduced (between 30 and 50 units) by the Loi du 8 pluviôse an IX (28 January 1801), or the "Law for the Reduction of the Number of District Courts", or Loi portant réduction du nombre de justices de paix in French. The département prefects were told by the government to group the communes within newly established cantons. The département lists, once approved by the government, were published in the Bulletin des lois in 1801 and 1802; these lists were the basis of the administrative divisions of France from then until 2015, although cantons with small populations were eliminated and new cantons created in areas of strong demographic growth. On the whole, their number increased appreciably.
In May 2013 a law was adopted that reduced the number of cantons drastically. This law came into effect at the French departmental elections in March 2015. Before the cantonal reform, there were 4,032 cantons, afterwards 2054, with the cantons in Martinique and Guyana abolished. The 2013 reform law also changed the representation of the cantons in the departmental councils: each canton is now represented by a man and a woman.
See also List of cantons of France