Obama acknowledged that school is tough and that it can be made even tougher by the presence of classroom bullies who make fun of students and try to make those who are different from them feel bad.
He said students should ignore the bulliers and celebrate the differences among them.
"What I want all of you, if you do take away one thing from my speech, I want you to take away the notion that life is precious, and part of what makes it so wonderful is its diversity," Obama said from a Philadelphia school during his second back-to-school address.
"We shouldn't be embarrassed by the things that make us different. We should be proud of them," he said. "Because it's the things that make us different that make us who we are, that make us unique."
After the White House announced last year's speech, some parents threatened to pull their kids from class during Obama's remarks. Conservatives also accused him of trying to inject politics into the classroom.
A similar outcry has been missing this year.
Schools were not required to show the speech, as was the case last year. Some schools also gave parents the option of having their kids participate in another activity during the broadcast. As with last year's speech, the White House released the text a day early so people could read it and judge for themselves.
Speaking from the auditorium at the Julia R. Masterman Laboratory and Demonstration School for fifth- through 12th-graders, Obama urged students to stay in school, study hard and take responsibility for their education. He said the nation's ability to compete globally in the 21st century depends on an educated work force.
He also said nothing is beyond their reach as long as they dream big, work hard and focus on learning.
"Nobody gets to write your destiny but you," Obama said.