The Metropolitan Police said Daniel Sheehan, of no fixed address, had been charged on Saturday.
He will appear in custody at Westminster Magistrates' Court on Monday.
No members of the Royal Family are thought to have been at the palace at the time of the alleged incident on Friday.
The Queen had undertaken an investiture ceremony at Windsor Castle earlier in the day.
A 21-year-old man has been charged with two counts of trespass after climbing a gate at Buckingham Palace, police say.