Although they are both billfish, marlins belong to the family Istiophoridae, while swordfish are the only members of the family Xiphiidae. Visually, the biggest difference is that marlins have a ridge on their back while swordfish have a single dorsal fin.
Marlins have a single large dorsal fin as well, but unlike that of the swordfish, the marlin's fin tapers down into a low ridge that runs along most of the fish's back. There are three types of marlin. These are the hatchet marlin, blue marlin and white marlin. All three have the distinctive ridge, although at varying heights.
Another visual difference between the marlin and the swordfish is that marlins have pelvic fins, which are located on the underside of the fish near its head. Swordfish do not have pelvic fins. Marlins also have double caudal keels, while swordfish have a single one. Body markings vary, with marlins having fin spots and body stripes, depending on the species, while swordfish tend to be solid in color.
Behaviorally, there is some evidence that swordfish use their bills in hunting more often than marlins do. Swordfish are more likely to slash prey to kill it, although both species rely more on speed to catch their food. Their range differs as well, with marlins living exclusively in the Atlantic Ocean, while swordfish are found in the Atlantic, Pacific and Indian Oceans.