John Cochrane (1798 – 2 March 1878) was a Scottish chess master and lawyer. After serving in the Royal Navy Cochrane chose to become a barrister. While studying law, he became a very strong chess player and published a book on the game, which included the Cochrane variation of the Salvio Gambit, a main line of the King's Gambit. Around this time he played against the Frenchmen Deschapelles and Labourdonnais, who were acknowledged to be Europe's strongest players at the time.
After a long tour of duty in India, he returned to the UK and beat everyone except Howard Staunton, whom he then helped to prepare for his victorious match against the Frenchman Saint-Amant, which established Staunton as the world's leading player. Cochrane returned to India, where he became known as the "Father of the Calcutta Bar" (association of barristers) and a leading member of the Calcutta Chess Club; the Club and Cochrane personally both made significant financial contributions to the first international chess tournament, which Staunton organised. Cochrane continued to play chess and to send games to the UK for publication, mostly in Staunton's columns. His two main opponents were Indians, and against one of them he made the first recorded use of the Cochrane Gambit against Petrov's Defence. When he returned to the UK for good, Cochrane continued to practise law part-time, mainly in important cases that arose in India, and wrote articles and books about the law. By this time he was too old for serious chess competition but played many casual games with strong players.
Cochrane is credited with discovering the Cochrane Defense, a technique to draw the difficult endgame defence of a rook against a rook and bishop. Cochrane is known for his dashing playing style – liberally sacrificing pieces and always attacking. His best-known opening innovations are generally regarded as dubious, although the Cochrane Gambit is still occasionally used as a surprise weapon in master chess. Commentators during his life and after his death expressed strong affection for him.