> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phantom.com/llms.txt
> Use this file to discover all available pages before exploring further.

# chainId

> Read the chainId property to get the hex-encoded ID of the network Phantom is currently connected to.

## window\.phantom.ethereum.chainId

The `chainId` of the network you are currently connected to, returned as a hexadecimal string.

```javascript theme={null}
const chainId = window.phantom.ethereum.chainId;
console.log(chainId);
// "0x1"
// hexadecimal representation of Ethereum Mainnet
```
