Which sentence is more formal?

 - It takes courage to stand up for people who are being bullied.
 - It takes guts to stand up for people who are being bullied.
The second sentence is less formal. You can tell because it uses slang (takes guts).
The first sentence uses formal language in place of the slang, so it is more formal overall.