Is it better to use an axe or sword in Minecraft?

Solution 1:

An axe does 2 more damage than a sword would. If a diamond sword does 7 damage, then a diamond axe would do 9 damage. To get the most damage, you have to wait a bit more for the cooldown to finish. Using an axe is sometimes quicker because you need to hit an enemy once, and it might just die right then and there, whereas a sword would take 2 or 3 hits. Speedrunners use axes because it does more damage, but in a lets-play, it isn't a good idea because, for each hit, it takes away two durability.

Solution 2:

When unenchanted, axe does 2 more damage and loses twice as much durability. When enchanted, sword is far better because of enchantments available (sweeping edge, fire aspect, knockback, looting)

Solution 3:

Using both is best. Keep an axe in your hand to charge it. Then, when the enemy comes, do a crit with an axe. It would do 15 damage. Then, switch to your sword. The sword has higher DPS then the axe, so finish off your enemy(ies) with the sword.