How to Get Category count in Magento 2?

Retrieve the category count total for the store in Magento 2 using the getCount() method.

If you require the number of category count for the Magento store, You can easily fetch that info by the Magento\Catalog\Api\CategoryManagementInterface.

Create a simple Model class to retrieve the total number of category,

Call method using, $categoryCount = $this->getCategoryCount();