The history of electromagnetic theory begins with ancient measures to understand atmospheric electricity, in particular lightning.Bruno Kolbe, Francis ed Legge, Joseph Skellon, tr., "An Introduction to Electricity". Kegan Paul, Trench, Trübner, 1908. 429 pages. Page 391. (cf. "[...] high poles covered with copper plates and with gilded tops were erected 'to break the stones coming from on high'. J. Dümichen, Baugeschichte des Dendera-Tempels, Strassburg, 1877") People then had little understanding of electricity, and were unable to explain the phenomena.Urbanitzky, A. v., & Wormell, R. (1886). Electricity in the service of man: a popular and practical treatise on the applications of electricity in modern life. London: Cassell &. Scientific understanding and research into the nature of electricity grew throughout the eighteenth and nineteenth centuries through the work of researchers such as André-Marie Ampère, Charles-Augustin de Coulomb, Michael Faraday, Carl Friedrich Gauss and James Clerk Maxwell.

In the 19th century it had become clear that electricity and magnetism were related, and their theories were unified: wherever charges are in motion electric current results, and magnetism is due to electric current.Lyons, T. A. (1901). A treatise on electromagnetic phenomena, and on the compass and its deviations aboard ship. Mathematical, theoretical, and practical. New York: J. Wiley & Sons. The source for electric field is electric charge, whereas that for magnetic field is electric current (charges in motion).

Ancient and classical history The knowledge of static electricity dates back to the earliest civilizations, but for millennia it remained merely an interesting and mystifying phenomenon, without a theory to explain its behavior, and it was often confused with magnetism. The ancients were acquainted with rather curious properties possessed by two minerals, amber (, ) and magnetic iron ore ( ,Platonis Opera, Meyer and Zeller, 1839, p. 989. "the Magnesian stone,The location of Magnesia is debated; it could be the region in mainland Greece or Magnesia ad Sipylum. See, for example, lodestone"). Amber, when rubbed, attracts lightweight objects, such as feathers; magnetic iron ore has the power of attracting iron.Whittaker, E. T. (1910). A history of the theories of aether and electricity from the age of Descartes to the close of the 19th century. Dublin University Press series. London: Longmans, Green and Co.; [etc.].

Based on his find of an Olmec hematite artifact in Central America, the American astronomer John Carlson has suggested that "the Olmec may have discovered and used the geomagnetic lodestone compass earlier than 1000 BC". If true, this "predates the Chinese discovery of the geomagnetic lodestone compass by more than a millennium". Carlson speculates that the Olmecs may have used similar artifacts as a directional device for astrological or geomantic purposes, or to orient their temples, the dwellings of the living or the interments of the dead. The earliest Chinese literature reference to magnetism lies in a 4th-century BC book called The Book of the Devil Valley Master: "When the people of Cheng go out to collect jade, they carry a south-pointer with them so as not to lose their way."

Long before any knowledge of electromagnetism existed, people were aware of the effects of electricity. Lightning and other manifestations of electricity such as St. Elmo's fire were known in ancient times, but it was not understood that these phenomena had a common origin.Maver, William, Jr.: "Electricity, its History and Progress", The Encyclopedia Americana; a library of universal knowledge, vol. X, pp. 172ff. (1918). New York: Encyclopedia Americana Corp. Ancient Egyptians were aware of shocks when interacting with electric fish (such as the electric catfish) or other animals (such as electric eels).Heinrich Karl Brugsch-Bey and Henry Danby Seymour, "A History of Egypt Under the Pharaohs". J. Murray, 1881. Page 422. (cf. [... the symbol of a] 'serpent' is rather a fish, which still serves, in the Coptic language, to designate the electric fish [...]) The shocks from animals were apparent to observers since pre-history by a variety of peoples that came into contact with them. Texts from 2750 BC by the ancient Egyptians referred to these fish as "thunderer of the Nile" and saw them as the "protectors" of all the other fish. Another possible approach to the discovery of the identity of lightning and electricity from any other source, is to be attributed to the Arabs, who before the 15th century used the same Arabic word for lightning () and the electric ray.

Thales of Miletus, writing at around 600 BC, noted that rubbing fur on various substances such as amber would cause them to attract specks of dust and other light objects. Thales wrote on the effect now known as static electricity. The Greeks noted that if they rubbed the amber for long enough they could even get an electric spark to jump.

The ancient Indian medical text Sushruta Samhita describes using magnetic properties of the lodestone to remove arrows embedded in a person's body.

These electrostatic phenomena were again reported millennia later by Roman and Arabic naturalists and physicians. Several ancient writers, such as Pliny the Elder and Scribonius Largus, attested to the numbing effect of electric shocks delivered by catfish and electric rays. Pliny in his books writes: "The ancient Tuscans by their learning hold that there are nine gods that send forth lightning and those of eleven sorts." This was in general the early pagan idea of lightning. The ancients held some concept that shocks could travel along conducting objects. Patients with ailments such as gout or headache were directed to touch electric fish in the hope that the powerful jolt might cure them.

A group of objects found in Iraq in 1938 dated to the early centuries AD (Sassanid Mesopotamia), called the Baghdad Battery, resembles a galvanic cell and is believed by some to have been used for electroplating. The claims are controversial because of supporting evidence and theories for the uses of the artifacts, physical evidence on the objects conducive for electrical functions, and if they were electrical in nature. Despite, or perhaps as a consequence of this uncertainty, discussing the possible ancient technology may engage young students in the science questions.Corder, Gregory W. "Using an unconventional history of the battery to engage students and explore the importance of evidence." Journal of Virginia Science Education 1.1 (2006): 33.

Magnetic attraction was once accounted for by Aristotle and Thales as the working of a soul in the stone.A history of electricity. By Park Benjamin. Pg 33

Middle Ages and the Renaissance

The magnetic needle compass was developed in the 11th century and it improved the accuracy of navigation by employing the astronomical concept of true north (Dream Pool Essays, 1088). The Chinese scientist Shen Kuo (1031–1095) was the first person known to write about the magnetic needle compass and by the 12th century Chinese were known to use the lodestone compass for navigation. In Europe, the first description of the compass and its use for navigation are of Alexander Neckam (1187), although the use of compasses was already common. Its development, in European history, was due to Flavio Gioja from Amalfi.

In the 13th century, Peter Peregrinus, a native of Maricourt in Picardy, conducted experiments on magnetism and wrote the first extant treatise describing the properties of magnets and pivoting compass needles. In 1282, the properties of magnets and dry compasses were discussed by Al-Ashraf Umar II, a Yemeni scholar. The dry compass was invented around 1300 by Italian inventor Flavio Gioja.Lane, Frederic C. (1963) "The Economic Meaning of the Invention of the Compass", The American Historical Review, 68 (3: April), p. 605–617 Magnetism remained elusive to Thomas Aquinas, who in his Summa Theologiae presented it as an example of an "occult"—that is, an unknown—force.

Archbishop Eustathius of Thessalonica, Greek scholar and writer of the 12th century, records that Woliver, king of the Goths, was able to draw sparks from his body. The same writer states that a certain philosopher was able while dressing to draw sparks from his clothes, a result seemingly akin to that obtained by Robert Symmer in his silk stocking experiments, a careful account of which may be found in the Philosophical Transactions, 1759.

Italian physician Gerolamo Cardano wrote about electricity in De Subtilitate (1550) distinguishing, perhaps for the first time, between electrical and magnetic forces.

17th century Toward the late 16th century, a physician of Queen Elizabeth's time, William Gilbert, in De Magnete, expanded on Cardano's work and invented the Neo-Latin word from (), the Greek word for "amber".

Gilbert undertook a number of careful electrical experiments, in the course of which he discovered that many substances other than amber, such as sulphur, wax, glass, etc.,consult ' Priestley's 'History of Electricity,' London 1757 were capable of manifesting electrical properties. Gilbert also discovered that a heated body lost its electricity and that moisture prevented the electrification of all bodies, due to the now well-known fact that moisture impaired the insulation of such bodies. He also noticed that electrified substances attracted all other substances indiscriminately, whereas a magnet only attracted iron. The many discoveries of this nature earned for Gilbert the title of founder of the electrical science. By investigating the forces on a light metallic needle, balanced on a point, he extended the list of electric bodies, and found also that many substances, including metals and natural magnets, showed no attractive forces when rubbed. He noticed that dry weather with north or east wind was the most favourable atmospheric condition for exhibiting electric phenomena—an observation liable to misconception until the difference between conductor and insulator was understood.Dampier, W. C. D. (1905). The theory of experimental electricity. Cambridge physical series. Cambridge [Eng.: University Press.

Gilbert's work was followed up by Robert Boyle (1627–1691), the famous natural philosopher who was once described as "father of Chemistry, and uncle of the Earl of Cork." Boyle was one of the founders of the Royal Society when it met privately in Oxford, and became a member of the council after the Society was incorporated by Charles II in 1663. He left a detailed account of his research under the title of Experiments on the Origin of Electricity. He discovered electrified bodies attracted light substances in a vacuum, indicating the electrical effect did not depend upon the air as a medium. He also added resin, and other substances, to the then known list of electrics.Robert Boyle (1675). Experiments and notes about the mechanical origin or production of particular qualities.Benjamin, P. (1895). A history of electricity: (The intellectual rise in electricity) from antiquity to the days of Benjamin Franklin. New York: J. Wiley & Sons.Consult Boyle's 'Experiments on the Origin of Electricity,'" and Priestley's 'History of Electricity'.

In 1663 Otto von Guericke invented a device that is now recognized as an early (possibly the first) electrostatic generator, but he did not recognize it primarily as an electrical device or conduct electrical experiments with it. By the end of the 17th century, researchers had developed practical means of generating electricity by friction with an electrostatic generator, but the development of electrostatic machines did not begin in earnest until the 18th century, when they became fundamental instruments in the studies about the new science of electricity.

The first usage of the word electricity is ascribed to Sir Thomas Browne in his 1646 work, Pseudodoxia Epidemica.