During the period 1792-1815 there was almost constant conflict between Great Britain and France, namely the French Revolutionary wars and Napoleonic wars. During this period, America traded with both sides of the conflicts. Each side strove to prevent America from trading with the other, and in the process American interests were injured by both sides.
Britain's decisive victory at the Battle Of Trafalgar and the blockading of French ports prompted Napoleon to cut Britain off from trading with Europe and America. Napoleon's 'Continental System' designated any ships that visited British ports as enemy vesels. Britain's response was to issue a regulation (Orders in Council) requiring neutral ships to obtain licences at English ports before trading with France. France then decreed that any neutral ship that had been searched by the British could be captured. American ships thus faced capture by the French if they obeyed Britain, and capture by the Royal Navy if they obeyed Napoleon.
The Royal Navy's use of impressment -- thousands of alleged RN deserters, U.S. citizens, were accosted -- provoked the Americans, who ineffectively tried counter embargoes.
British shipping and manufacturing interests demanded that the RN sustain trade against 'Yankee' competitors, convincing many Americans that they were being treated as colonials, while people in Britain countered that the U.S. was a participant in Napoleon's Continental System.
Events on the American Northwest frontier added further tensions; most American Indians in that area were convinced that their only hope of stemming the flood of American settlers lay with the British. Canadians believed that American expansionists were using Indian unrest as a cover for a war of conquest.
President Madison, under increasing pressure, sent a war message to the U.S. Congress on 1st June, 1812. The vote split the House (79-49) and was perilously close in the Senate (19-13). Westerners and southerners (southern support was encouraged by the prospect of taking East and West Florida from Spain) supported the war, while seafaring New Engladers were against it.