The 19-year-old, who trailed fellow Japanese Tatsuki Machida by nearly seven points after the short program in Saitama, produced a near-flawless free skate to finish with 282.59 points, just three-tenths of a point ahead of Machida.
Javier Fernandez of Spain was third with 275.93.
"That was very close," Hanyu said. "I work hard to become a skater who can always end with strong performances. I felt the responsibility to win the event."
Hanyu fell twice while winning the free skate in Sochi but had no falls on Friday.
His only deduction came on the triple flip and he got extra points on five straight jumps.
The men's Olympic-worlds double was last achieved by Alexei Yagudin in 2002.
- Sports & Recreation
- Ice Skating
- Tatsuki Machida
- Javier Fernandez