Understanding the patterns and drivers of biodiversity in intertidal zones is essential for developing effective conservation strategies. The taxonomic and functional diversity of macrofaunal communities was studied in the arid mangrove system of the Persian Gulf and Gulf of Oman. The study further aimed to investigate whether the main functional traits differ between habitats. All macrofauna samples and environmental variables were taken from two habitats including vegetated habitat and adjoining mudflats. A total of 85 taxa was found, of which 19 taxa were exclusive to vegetated habitats and 20 to mudflats. Mollusca were the most species-rich group in both habitats, followed by Arthropoda and Annelida. When comparing diversity indices among regions and habitats the Shannon-Wiener diversity index was significantly higher in vegetated habitats compared to mudflats. However, these trends were less consistent for the functional diversity measures being very much region-dependent. The results showed that functional trait structure was more uniform than the taxonomic structure across regions and habitats. The trait modalities biodiffuser, surface deposit-feeder, burrower, free-living, planktotrophic, 2–5 years, and 10–50 mm were common at both habitats. However, the modalities detritivore and grazer/scarper, and direct larval development were significantly higher in vegetated habitats than in mudflats. The vegetated habitats exhibited the more functionally redundant communities than mudflats, possibly due to higher taxonomic diversity observed in this habitat or the presence of the species with similar functions in the ecosystem. The combined investigation of species and functional diversity of mangrove macrofauna communities conducted in this research is essential for effective management and conservation efforts aimed at protecting mangrove ecosystems and to preserve the goods and services they provide.