Hartley was born in Lewiston, Maine where his English parents had settled.  He was the youngest of nine children and his birth name was Edmund.  His mother died when he was eight, and his father remarried four years later to Martha Marsden. He later assumed Marsden as his first name when he was in his early 20s. 

Hartley began his art training at the Cleveland Institute of Art  in 1892 after his family had moved to Cleveland.   He won a scholarship to the Cleveland School of Art.In 1898, at age 22, Hartley moved to New York City to study painting at the New York School of Art under William Merritt Chase, and then attended the National Academy of Design.Hartley was a great admirer of Albert Pinkham Ryder and his friendship with him, in addition to the writings of Walt Whitman and American transcendentalists Henry David Thoreau and Ralph Waldo Emerson, inspired Hartley to view art as a spiritual quest.

Hartley moved to an abandoned farm near Lovell, Maine iin 1908. He considered the paintings he produced there his first mature works, and they also impressed New York photographer and art promoter Alfred Stieglitz.Hartley had his first solo exhibition at Stieglitz's 291 in 1909, and exhibited his work there again in 1912. Stieglitz also provided Hartley's introduction to European modernist painters, of whom Cézanne, Picasso, and Matisse would prove the most influential upon him.

Hartley first traveled to Europe in April 1912, and he became acquainted withGertrude Stein's circle of avante-garde writers and artists in Paris.

 In 1913, Hartley moved to Berlin, where he continued to paint and befriended the painters Wassily Kandinsky  and Franz Marc.  His work during this period was a combination of abstraction and German Expressionism, fueled by his personal brand of mysticism.

Hartley finally returned to the U.S. in early 1916. He lived in Europe again from 1921 to 1930, when he moved back to the U.S. for good. He painted throughout the country and returned to settle in Maine in 1937, after declaring that he wanted to become "the painter of Maine" and depict American life at a local level. This aligned Hartley with the Regionalism movement, a group of artists active from the early- to-mid 20th century that attempted to represent a distinctly "American art."

He continued to paint until his death in 1943.