How to get current store information in Magento 2?

You can get Current store related data like store id, store name, group id, website id and available currency code using Magento 2 by just simple code snippets.

Call from Template file for getting the data of store,

Output for Current Store looks like below array,

Want to Know about Next blog, Get All Root Categories Ids in Magento 2.

How to get default website id in Magento 2?

For Multi website setup of Magento e-commerce site, Sometimes need to get Default Website id using programmatically, You need to refer below code snippet for getting default website id.

Hope, You are aware of how to get website collection and other details using coding.
Create Block file,

Call from template file or PHP file,

echo $this->getDefaultWebsiteId(); // output is your default website code.
For single website output is 1.