How to get Ethereum Block Gas Limit

There are several ways.

Geth command

If you run your Geth node, you can just run the following command.



You can get Ethereum Block Gas Limit through JSON RPC API as well.

If you run the example command below, you will get a JSON response. In the JSON response, you can check gasLimit value.

curl -i -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", true],"id":1}' \


With web3.js, you can get Block Gas Limit by following code.

web3.eth.getBlock("latest", false, (error, result) => {
// => 8000029


The easiest way ;)


  • In Ethereum, Block Gas Limit is changed in every block. The new Block Gas Limit is decided by algorithm and vote by miners.
  • If you try to send a transaction with Gas Limit which exceeds Block Gas Limit, the “Exceeds block gas limit” error shows.
  • Currently (May 4th 2018), Block Gas Limit in mainnet is about 8000000.
  • In Ropsten, 4712388. It looks like fixed.
  • NOTE: Block Gas Limit is different between Mainnet and Ropsten.
  • I spent few hours because of this difference.
  • When you run Geth, you can use “ — targetgaslimit” to set Block Gas Limit target. This can help you when you develop/test with your own private chain. By default, targetgaslimit is 4712388.



If you find this article is helpful, it would be greatly appreciated if you could tip Ether to the address below. Thank you!


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store