Most ferries that have a car deck for vehicles also carry bikes and you can take your bike on board. Regardless of whether you have to pay or not, you will probably be required to book a ticket for the bike.
If you are traveling to/in Spain, please note that some of the ferry companies that require ticket for the bike are Balearia, Corsica Ferries, Fred Olsen, Naviera Armas, Trasmediterránea, and FRS.
Whereas, if you have selected Grandi Navi Veloci (GNV), Trasmed, Trasmapi, MedPi, Aquabus, Líneas Romero, or Africa Morocco Link (AML) for your trip, you can bring your bike on board, without having to book a ticket for it.
Please note that small catamarans or high-speed ferries may have stricter rules regarding bringing bikes on board. Make sure that you check the company’s rules for the specific route and ferry before booking.