> For the complete documentation index, see [llms.txt](https://docs.clv.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clv.org/portal/technical-documentation/web3-compatibility/eth_estimategas.md).

# eth\_estimateGas

```
web3.eth.estimateGas(callObject [, callback])
```

#### Parameters

1. A transaction object.
2. (optional) Optional callback, returns an error object as first parameter and the result as second.

#### Returns

the used gas for the simulated call/transaction.

#### Example

```
web3.eth.estimateGas({
    from : account1,
    to : account2
}).then(console.log);
> 21000
```
