OnFinality
New RPC users get 35% off their first monthView the offer
RPC Assistant

What is the BSC chain ID and how do you configure it?

Summary

The BNB Smart Chain (BSC) mainnet chain ID is **56** in decimal, or **0x38** in hexadecimal. Its native currency is BNB, and the canonical block explorer is BscScan. The BNB Smart Chain testnet uses chain ID **97** in decimal, or **0x61** in hexadecimal, with tBNB as its test token.

Use chain ID 56 when connecting a wallet, signing transactions, or configuring an EVM application for BSC mainnet. Use 97 only for BSC testnet development. The chain ID is not an RPC URL: your application still needs an endpoint, such as the OnFinality BNB Chain RPC API endpoint, to read data and submit JSON-RPC requests. Before sending transactions, verify the endpoint with eth_chainId so your application does not sign for the wrong network.

Key Takeaways

  • BSC mainnet uses chain ID 56, represented as 0x38 in hexadecimal.
  • BSC testnet uses chain ID 97, represented as 0x61 in hexadecimal.
  • Mainnet uses BNB, while the testnet uses tBNB for development.
  • A chain ID identifies the network for EVM transaction signing; it is separate from an RPC endpoint.
  • The OnFinality BNB Chain endpoint is https://bnb.api.onfinality.io/public.
  • Use eth_chainId to confirm that an RPC endpoint is connected to the network your application expects.
  • Never use a testnet chain ID or testnet funds in a production transaction flow.

Chain settings at a glance

The term BSC usually refers to BNB Smart Chain. For the standard BSC EVM network, the mainnet and testnet settings are different. Selecting the wrong chain ID can cause wallet mismatches, rejected transactions, or applications reading from an unintended environment.

The values below align with the BNB Smart Chain network configuration used for the OnFinality BNB and BNB Chain Testnet network pages.

  • Mainnet chain ID: 56 decimal, 0x38 hexadecimal.
  • Testnet chain ID: 97 decimal, 0x61 hexadecimal.
  • Mainnet native currency: BNB.
  • Testnet native currency: tBNB.
  • Mainnet explorer: https://bscscan.com.
  • Testnet explorer: https://testnet.bscscan.com.
CriterionWhat to checkWhy it matters
BNB Smart Chain MainnetChain ID 56 (0x38); currency BNB; explorer https://bscscan.comUse this configuration for live BSC contracts, balances, and transactions.
BNB Smart Chain TestnetChain ID 97 (0x61); currency tBNB; explorer https://testnet.bscscan.comUse this configuration for testing and development rather than live funds.

The practical decision: mainnet, testnet, or another BNB network?

Choose BSC mainnet when the application must interact with deployed production contracts or real BNB and token balances. Choose BSC testnet when you are developing contracts, testing wallet flows, or running CI checks without using production assets.

Do not infer the correct chain from the name alone. BNB Chain includes multiple networks and products, and an RPC endpoint for one network should not be paired with another network's chain ID. Keep the chain ID, RPC URL, native currency, and explorer URL in the same environment-specific configuration.

For a managed BSC connection, the OnFinality BNB Chain RPC page provides the network-specific API option. If you are comparing endpoint plans, consult RPC pricing rather than treating a public endpoint as a universal fit for every workload.

  • Use 56 for BSC mainnet application configuration.
  • Use 97 for BSC testnet application configuration.
  • Keep testnet and mainnet environment variables separate.
  • Do not use opBNB, BNB Greenfield, or another BNB ecosystem network's ID as a substitute for BSC.
CriterionWhat to checkWhy it matters
Wallet connectionThe wallet network and RPC response both identify the intended chainPrevents users from signing on an unexpected network.
Backend readsThe endpoint returns the expected chain ID before requests beginPrevents indexers and services from storing data from the wrong chain.
Transaction signingThe transaction's chain context is 56 for mainnet or 97 for testnetEVM signatures include chain protection against replay across networks.

Configure a BSC RPC endpoint

The chain ID is only one part of an EVM network configuration. Your application also needs a JSON-RPC endpoint. The matching OnFinality network configuration lists https://bnb.api.onfinality.io/public for BNB Smart Chain mainnet and https://bnb-testnet.api.onfinality.io/public for BNB Chain Testnet.

For a mainnet connectivity check, send a standard JSON-RPC request to the OnFinality BNB endpoint:

  • HTTP transport: https://bnb.api.onfinality.io/public
  • JSON-RPC method for identification: eth_chainId
  • Expected mainnet response quantity: 0x38
  • Expected testnet response quantity: 0x61 when using the testnet endpoint
CriterionWhat to checkWhy it matters
RPC URLThe URL belongs to the same environment as the chain IDA correct chain ID paired with the wrong endpoint still creates an invalid configuration.
TransportYour client supports the endpoint's HTTP or WebSocket transportRead requests, subscriptions, and transaction workflows may use different transports.
Access policyThe endpoint and plan support the expected request volume and methodsA development configuration may not be appropriate for a production workload.

Verify the network before your application sends transactions

JSON-RPC quantities are hexadecimal strings. Therefore, a successful eth_chainId response for BSC mainnet should contain 0x38, while BSC testnet should return 0x61. This check is inexpensive and should run during service startup, deployment validation, or endpoint failover.

The following command checks the OnFinality BNB Chain mainnet endpoint without exposing a private key:

  • Compare the returned value with the environment variable your service expects.
  • Stop startup or mark the endpoint unhealthy if the values differ.
  • Check the endpoint again after changing RPC providers or network configuration.
  • Treat a wallet's displayed network name as a user-interface value; use eth_chainId for programmatic verification.
CriterionWhat to checkWhy it matters
Expected resultThe JSON-RPC result is 0x38 for BSC mainnetConfirms that the endpoint reports the intended EVM network.
Unexpected resultThe result is 0x61 or another hexadecimal quantityIndicates a testnet or different network configuration.
No responseHTTP status, JSON formatting, authentication, and endpoint availabilityA transport or access failure must be fixed before chain identity can be trusted.

Wallet and application configuration example

When adding BSC manually to an EVM wallet, use the mainnet values below. Wallet interfaces may label the network as BNB Smart Chain or BSC, but the chain ID must remain numeric 56.

For a testnet wallet, replace the chain name, RPC URL, chain ID, currency symbol, and explorer with the testnet values. Fund testnet accounts only with test tokens intended for that environment.

CriterionWhat to checkWhy it matters
Hardhat or deployment configurationThe network's chainId is 56 for mainnet and the RPC URL is environment-specificDeployment tools use chain IDs to prevent accidental deployment to the wrong network.
Frontend wallet requestThe requested chain ID is 0x38 for BSC mainnetWallet APIs commonly represent EVM chain IDs as hexadecimal quantities.
Environment variablesMainnet and testnet values are stored in separate deployment environmentsReduces the chance that a test configuration reaches production.

Failure modes worth checking

Most BSC chain ID problems are configuration mismatches rather than contract errors. Diagnose the network identity first, then inspect account balances, contract addresses, gas settings, and application logic.

If you need an endpoint for a workload with sustained reads, logs, WebSocket subscriptions, or transaction submission, evaluate the required methods and limits against the chosen RPC plan. A managed RPC API and dedicated node infrastructure solve different operational requirements; the dedicated node option is a separate path from a shared API endpoint.

  • Wallet says the chain is already configured: compare the wallet's chain ID with the application's expected value.
  • Transactions are rejected: confirm that the signing wallet and RPC endpoint both target chain ID 56 or both target 97.
  • Balances appear as zero: verify the token contract address and check that the address belongs to the same network.
  • Contract calls fail after switching endpoints: call eth_chainId and inspect whether the new endpoint serves the same network.
  • Logs are incomplete or unavailable: check the provider's method support, request limits, and historical data policy before changing application logic.
  • Testnet funds do not appear on mainnet: this is expected because the networks have separate state and assets.
CriterionWhat to checkWhy it matters
Wrong-chain errorWallet chain ID, RPC eth_chainId result, and deployment configurationAll three must describe the same network.
Unknown contractContract address and explorer networkAn address can exist on one EVM network but have no code on another.
RPC method failureProvider method support, limits, and access requirementsNetwork identity alone does not guarantee that every method is available under every plan.

Frequently Asked Questions

What is the BSC mainnet chain ID?

The BNB Smart Chain mainnet chain ID is 56 in decimal and 0x38 in hexadecimal.

What is the BSC testnet chain ID?

The BNB Smart Chain testnet chain ID is 97 in decimal and 0x61 in hexadecimal.

Is BSC chain ID the same as the RPC URL?

No. The chain ID identifies the EVM network used for wallet and transaction context. The RPC URL is the service endpoint your application uses to send JSON-RPC requests.

What is the BSC RPC URL for OnFinality?

The OnFinality BNB Smart Chain network configuration lists https://bnb.api.onfinality.io/public as the public HTTP RPC endpoint. Check the BNB Chain network page for the current connection options.

How can I check whether my RPC endpoint is connected to BSC?

Call the JSON-RPC method eth_chainId. Expect 0x38 for BSC mainnet or 0x61 for BSC testnet. Do not send a transaction until the response matches the environment your application expects.

Can I use the BSC chain ID with any EVM wallet?

Most EVM-compatible wallets can represent BSC, but you must provide a compatible RPC endpoint and the correct network settings. Wallet support does not make mainnet and testnet interchangeable.

RPC Knowledge Base

Related RPC details

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started