The 26-year-old took the crown with 6,981 points - beating Jessica Ennis-Hill’s previous national record.
Nafi Thiam, who holds the Olympic title, had been odds-on favourite to defend her 2017 victory before the start of competition but finished second on 6,677 points, with Austria’s Verena Preiner in third place.
Belgium’s Thiam has been untouchable for the last three years, winning world, European and Olympic titles. She had not lost since Gotzis in 2016.
But Johnson-Thompson sent out a major warning to Thiam ahead of next year’s Olympics in Tokyo and won Great Britain’s second gold in Qatar after Dina Asher-Smith’s 200m victory on Wednesday.
The Liverpudlian joins an exclusive club of eight British women to have won individual world gold - including Asher-Smith and Ennis-Hill, who has three heptathlon titles.
It was also sweet redemption after her nightmare World Championships in Beijing in 2015 following three long jump failures and a high jump shocker in London two years ago.
A poor long jump and javelin from Thiam put Johnson-Thompson in control on the second day at the Khalifa International Stadium.
Johnson-Thompson won the long jump with a leap of 6.77m – well ahead of Thiam’s 6.35m – which gave her a lead of 216 points with two events left.
Thiam tried to recover in the javelin but, hampered by a long-standing elbow injury, walked off the track before her final throw having posted just 48.04m.
Johnson-Thompson’s new personal best of 43.93m gave her a virtually unassailable 137-point lead heading into the final event, the 800m.
She then completed the upset with a time of two minutes 07.26 seconds over the two laps.