Question: who was the last president that was not a democrat or republican
Answer: Representative for Illinois 's 7th District ( 1847 -- 1849 ) Republican ( National Union ) ( 1860 ) 19 ( 1861 ) Hannibal Hamlin March 4 , 1861 -- March 4 , 1865 ( 1864 ) 20 ( 1865 ) ( 1865 ) Andrew Johnson March 4 -- April 15 , 1865 ( Succeeded to presidency ) 17 April 15 , 1865 -- March 4 , 1869 Andrew Johnson 1808 -- 1875 ( Lived : 66 years ) 16th Vice President of the United States National Union April 15 , 1865 -- c.