Sometimes the best way forward is a giant leap sideways.

Here are 10 companies that bet big on a new direction and were wildly successful. Perhaps it's time you took a chance and changed things up.

1. Wrigley: William Wrigley Jr. began by hawking soap and baking powder in the late 19th century. To drum up business, he gave away sticks of chewing gum, but he noticed that customers were more excited about the freebie than his products. The gum stuck.

The payoff: Now a Mars subsidiary, it is the world's largest gum manufacturer.

2. Nintendo: Fusajiro Yamauchi founded Nintendo in 1889 as a purveyor of playing cards. His great-grandson unsuccessfully expanded the company into taxis and “love hotels” before hitting gold in the 1970s with an electronic shooting game.

The payoff: Gaming domination via Super Mario Bros., Game Boy, Wii, Pokémon Go, etc.

3. Listerine: The mouthwash was first marketed as a general-purpose antiseptic, meant to get rid of both household grime and gonorrhea. In 1914, pharmaceutical company Warner-Lambert started selling it as a halitosis remedy.

The payoff: Current owner Johnson & Johnson sold $340 million worth of the stuff in 2015.

4. 3M: The Minnesota Mining and Manufacturing Company (get it? 3M) originally planned to sell excavated minerals to manufacturers. But when that didn't work out as planned, it shifted to producing finished items, such as sandpaper.

The payoff: Some 60,000 products later, 3M makes everything from Post-its to surgical soap.

5. Texas Instruments: Geophysical Services Inc. made technology to help gas companies find oil. World War II forced GSI to halt its profitable overseas business, so in 1946 it formed a lab to develop electronics.

The payoff: The lab grew into Texas Instruments, maker of your calculator and still a top semiconductor producer.

6. Pixar: When Steve Jobs bought into the business that would become Pixar, it was a maker of graphics-oriented computers. He refocused on software, and Pixar later started making animated films.

The payoff: Pixar's movies have pulled in more than $10 billion over the past 21 years.

7. PayPal: Conceived as a mobile-encryption service, the company switched to cash transactions (initially between PalmPilots). After eBay users latched onto the service, PayPal developed into the leading tool for web-based payments.

The payoff: PayPal helped fuel the e-commerce boom and today is worth more than $47 billion.

8. Flickr: Caterina Fake and then-husband Stewart Butterfield started Ludicorp to develop online games in 2002. One feature let players save pics, and it proved so popular they moved away from games and built a photo-sharing service.

The payoff: Flickr became the go-to home for digital photos and was acquired by Yahoo in 2005.

9. YouTube: YouTube launched in 2005 as a video-dating site. Users didn't bite, but the company's founders soon noticed that people had started sharing other kinds of video content.

The payoff: YouTube is the world's second-most-visited site (after Google). Viewers consume 3.3 billion hours of video every month.

10. Instagram: Burbn tried to be many things: a Foursquare-style check-in app, a friend-meetup service and a photo-sharing tool. Noticing that photos were users' favorite feature, Kevin Systrom ditched the other functions and rebranded as Instagram.

The payoff: More than 500 million monthly users post 95 million photos and videos a day.