The service is expected to be introduced by the end of this year.
Barra Youth Council had been campaigning for wi-fi on the ferries and has been running a petition on the Scottish Parliament's website.
Western Isles SNP MSP Alasdair Allan and MP Angus MacNeil have welcomed CalMac's decision.
The youth council's petition asks MSPs to urge the Scottish government to ensure wi-fi is available on the Caledonian MacBrayne ferries. The petition was due to close at 16:00.
Outer Hebrides Community Planning Partnership had backed the call.
Partnership chairman Angus Campbell said it was good to see young islanders getting involved in the democratic process.
Ferry operator Caledonian MacBrayne will make wi-fi available on all its sailings between the Western Isles and the mainland, it has been announced.