"I'm here to tell you now that I am going to get in," Mr Sanford, a long-time Trump critic, said in an interview announcing his candidacy.
He is the third person to challenge Mr Trump for the nomination.
It is seen as near impossible that anyone will take the Republican mantle from the president.
No sitting president in the modern era has lost the race to be nominee for their own party, and Mr Trump remains very popular with Republicans.
The Republican National Convention, at which the nominee will be formally chosen, will take place in late August 2020 after a series of state primary elections and party caucuses.
But some state Republican parties, including in South Carolina, have decided not to hold primaries in 2020 - to clear the path for Mr Trump and save money.
Mr Sanford, 59, is expected to centre his campaign on cutting government debt and spending.
"I think we need to have a conversation on what it means to be a Republican. I think that as a Republican party we have lost our way," he told Fox News on Sunday.
"We have lost our way on debts and deficits and spending... The president has called himself the king of debt, has a familiarity and comfort level with debt that I think is ultimately leading us in the wrong direction."
Which Democrat will take on Trump in 2020?
How a young, gay mayor became a Democratic star
Anthony Zurcher casts his eye over the Democrats
In April, former Massachusetts Governor Bill Weld became the first person to challenge Mr Trump.
Who is Mark Sanford?
He first served in Congress in 1995, representing South Carolina's first congressional district. He later served as the state's governor for two terms from 2003-2011. He then returned to the House in 2013.
Mr Sanford criticised Mr Trump during the 2016 presidential election but ultimately supported him. However he would become one of his toughest Republican critics in Congress when Mr Trump took office.
That stance cost him the Republican primary when his seat was up for re-election last year. He was beaten by a pro-Trump challenger who went on to lose the election to her Democrat opponent.
He is known as a fiscal conservative and has been attacked by Mr Trump over an extra-marital affair that tainted his second term as governor.
He went missing for several days, with his staff telling reporters he had gone to hike the Appalachian Trail. He later admitted he had instead gone to Argentina to see his mistress.
Who will take on Trump in 2020?
Election day is still more than a year away but the race to become the Democratic challenger to Mr Trump is already well under way.
Joe Biden and Bernie Sanders have thrown their hats into the ring, but most of the other candidates are relatively unknown outside the Washington DC bubble.