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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/base-estimategas",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# eth_estimateGas | Base

The `eth_estimateGas` method estimates the amount of gas required to execute a transaction. This is useful for understanding how much gas might be consumed by a transaction before actually sending it. The estimation is not always accurate but provides a good approximation.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Request

To use `eth_estimateGas`, send a POST request with a JSON RPC call in the body.

## Parameters

A single object containing:

* **from** (`string`): (optional) The address the transaction is sent from.
* **to** (`string`): The address the transaction is directed to.
* **gas** (`string`): (optional) The gas limit provided by the sender.
* **gasPrice** (`string`): (optional) The gas price for the transaction.
* **value** (`string`): (optional) The value transferred for the transaction in Wei.
* **data** (`string`): (optional) The data sent along with the transaction.

## Response

The method returns the estimated gas required as a hexadecimal number.

* **result** (`string`): The estimated gas required for the transaction.

## Use case

The `eth_estimateGas` method is essential for:

* Developers to estimate transaction costs before sending them.
* Wallets and interfaces that calculate transaction fees.
* Optimizing smart contract interactions by understanding gas requirements.


## OpenAPI

````yaml /openapi/base_node_api/eth_estimateGas.json POST /2fc1de7f08c0465f6a28e3c355e0cb14
openapi: 3.0.0
info:
  title: eth_estimateGas example
  version: 1.0.0
  description: >-
    This is an API example for eth_estimateGas, a method to estimate the amount
    of gas that a transaction will  consume.
servers:
  - url: https://base-mainnet.core.chainstack.com
security: []
paths:
  /2fc1de7f08c0465f6a28e3c355e0cb14:
    post:
      tags:
        - Ethereum Operations
      summary: eth_estimateGas
      operationId: estimateGas
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_estimateGas
                id:
                  type: integer
                  default: 1
                params:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          from:
                            type: string
                            default: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
                          to:
                            type: string
                            default: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8'
                      - type: string
                        default: latest
                  default:
                    - from: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
                      to: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8'
                    - latest
      responses:
        '200':
          description: The estimated gas required
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````