How to get customer data by customer id in magento 2?

You can get customer information by just passing customer id using below code snippet, Create Block file,

Call getCustomer($id) function in template file,

Get all customer data by below way,

echo “<pre>”;print_r($customer->__toArray());