Mangrove sediment microorganisms play a vital role in the energy transformation and element cycling in marine wetland ecosystems. Using metagenomics analysis strategy, we compared the taxonomic structure and gene profile of the mangrove and non-mangrove sediment samples at the subtropical estuary in Beibu Gulf, South China Sea. Proteobacteria, Bacteroidetes, and Firmicutes were the most abundant bacterial phyla. Archaeal family Methanosarcinaceae and bacterial genera Vibrio and Dehalococcoides were significantly higher in the mangrove sediments than in the nonmangrove sediments. Functional analysis showed that “Carbohydrate metabolism” was the most abundant metabolic category. The feature of carbohydrate-active enzymes (CZs) was analyzed using the Carbohydrate-Active EnZymes Database. The significant differences of CZs between mangrove and non-mangrove sediments, were attributed to the amounts of polyphenol oxidase (EC 1.10.3.-), hexosyltransferase (EC 2.4.1.-), and β-N-acetylhexosaminidase (EC 3.2.1.52), which were higher in the mangrove sediment samples. Principal component analysis indicated that the microbial community and gene profile between mangrove and non-mangrove sediments were distinct. Redundancy analysis showed that total organic carbon is a significant factor that affects the microbial community and gene distribution. The results indicated that the mangrove ecosystem with massive amounts of organic carbon may promote the richness of carbohydrate metabolism genes and enhance the degradation and utilization of carbohydrates in the mangrove sediments.