President Barack Obama will give a farewell speech to the nation on Tuesday night, an effort to burnish his legacy, encourage demoralized supporters and express optimism about the future of the country.

Obama boarded Air Force One for his final trip to Chicago - where he kicked off his political career and started a family - with his wife, first lady Michelle Obama, and their elder daughter, Malia.

"The president is not one to be overly sentimental, but given the circumstances, I think it would be unrealistic to expect anybody to not feel some nostalgia for this moment," his spokesman, Josh Earnest told reporters travelling with Obama.

The Democratic president will leave the White House on Jan. 20 after eight years in office. His top policy achievements were jolted by the Nov. 8 election of Republican Donald Trump, who has threatened to undo Obama's actions on issues ranging from advancing healthcare reform to curbing climate.

Vice President Joe Biden, his wife, Jill Biden, and many current and former White House staff members and campaign workers will attend Obama's 8 p.m. CST (0200 GMT Wednesday) speech at McCormick Place, the city's main convention centre.

It was Obama's 445th trip on the presidential aircraft, a perk he has said he will miss when he leaves office. All told, he will have spent more than 2,800 hours or 116 days on the plane during his presidency, Earnest said.

Obama has said he plans to reflect on his administration's achievements while also looking forward in his address, encouraging supporters to keep fighting for issues he championed in his 2008 and 2012 campaigns on the environment, gay rights and economic equality.

Obama has encouraged Trump to rethink some of his views on repealing the Affordable Care Act, known as Obamacare, while mobilizing Democrats to stand up for the law under a Trump administration and a Republican-controlled Congress.

During his campaign, Trump promised to dismantle the law, ban Muslims temporarily from entering the United States and build a wall on the U.S. border with Mexico - all policies Obama opposes.

Obama plans to remain in Washington for the next two years while his younger daughter, Sasha, finishes high school. He has indicated he wants to give Trump the same space that his predecessor, Republican President George W. Bush, gave Obama after leaving office by not maintaining a high public profile.

That may be difficult if Trump makes good on his plans. Democrats, lacking a national leader with Obama's departure and former Secretary of State Hillary Clinton's election loss, are eager for Obama to stay involved on some level.