Paramedics were waiting at Airlie Beach when the tour boat arrived and the victims, conscious and alert, were flown by RACQ CQ Rescue helicopter to Mackay Base Hospital.
ZigZag Whitsundays, who operated the tour the men were on at the time of the attack, said: "We are saddened to confirm that two of our guests were injured in a shark attack this morning".
They were brought 7 miles by boat to the mainland town of Airlie Beach, where paramedics were waiting for them, Queensland state Ambulance Service spokeswoman Mel Mangan said.
Queensland Ambulance tweeted: "Two patients are being transported by road to a location on Proserpine Shute Harbour Road where they will meet up with the rescue helicopter".
Early reports suggest the incident occurred in Hook Passage, a popular snorkelling spot about 20 minutes offshore from Airlie Beach.
'Enjoy the play-off' - England's Jones hits back at Gatland jibe
All Blacks flanker Sam Cane left team-mate Sonny Bill Williams red-faced with a amusing interruption during a press conference. The crowds here generally at the World Cup have been fantastic.
Queensland Premier Annastacia Palaszczuk said she didn't know if the attack happened in an area where the drumlines were taken out. The drum lines were later removed due to their impact on the marine life.
There have been a number of shark attacks in the region in recent years.
The Whitsundays, near the Great Barrier Reef, have been the scene of several shark incidents recently. I don't know if it was off-shore.
After one of the attacks in 2018, the state government conducted a shark bait operation in which six sharks were hooked and killed within a week.
A shark killed a man in November a year ago in a Whitsunday Island harbor where two tourists had been mauled a month earlier.
That incident followed separate attacks within 24 hours in September - also at Cid Harbour - on Tasmanian woman Justine Barwick and Victorian 12-year-old Hannah Papps.