<p>In Bitcoin Core, there is the option to subtract the fee from the amount. When you create a transaction, you set the amount to be the maximum amounts, and then you enable the subtract fee from amount options which will then reduce the specified outputs by the fee. This way, you can choose to send your entire balance without change and have the fee be subtracted from the output.</p>

<p>In the GUI (bitcoin-qt), there is a checkbox labeled "Subtract fee from amount" which you can set for each recipient. You can use the "Use available balance" button to auto-fill the full wallet balance. It will also automatically check that option for you.</p>

<p>If you are using bitcoind over the RPC interface, <code>sendtoaddress</code> has a parameter <code>subtractfeefromamount</code> which you can set to <code>true</code> in order to deduct the fee from the amount you are sending. <code>sendmany</code> has a similar option but it is instead an array of addresses so you specify the addresses that will receive less due to the fee being subtracted from their amounts.</p>

CC BY-SA 4.0
2018-11-07T15:31:23.023Z
ye i know about subtractfeefromamount but i need to calculate amount before(!) send, so with your example we'll understand how much we sent only after processing transaction
Dimedrol
CC BY-SA 4.0
2018-11-07T15:39:27.757Z
You can use fundrawtransaction with the subtractFeeFrom option to construct a transaction (but not sign or broadcast it). Then you can look at the amount in the output to see how much will actually be sent.
Ava Chow
CC BY-SA 4.0
2018-11-07T05:12:38.177Z
2018-11-07T05:12:38.177Z
Ava Chow
<p>Using latest bitoind, any way to calculate max spendable from wallet with some amount of outputs? For example i need to send all wallet amount to 2 outputs and set mining fee enough to get confirmation in first block. How can i calculate max spendable amount?</p>

<bitcoin-core><bitcoind><bitcoin-core-development>
how to calculate max spendable from all wallet
Dimedrol
# how to calculate max spendable from all wallet

(Asked by: username_0 on 2018-11-07)

Using latest bitoind, any way to calculate max spendable from wallet with some amount of outputs? For example i need to send all wallet amount to 2 outputs and set mining fee enough to get confirmation in first block. How can i calculate max spendable amount?

**Tags:** bitcoin-core, bitcoind, bitcoin-core-development


---

## 1 answers

### Answer by username_1 on 2018-11-07. Score: 1

In Bitcoin Core, there is the option to subtract the fee from the amount. When you create a transaction, you set the amount to be the maximum amounts, and then you enable the subtract fee from amount options which will then reduce the specified outputs by the fee. This way, you can choose to send your entire balance without change and have the fee be subtracted from the output.

In the GUI (bitcoin-qt), there is a checkbox labeled "Subtract fee from amount" which you can set for each recipient. You can use the "Use available balance" button to auto-fill the full wallet balance. It will also automatically check that option for you.

If you are using bitcoind over the RPC interface, `sendtoaddress` has a parameter `subtractfeefromamount` which you can set to `true` in order to deduct the fee from the amount you are sending. `sendmany` has a similar option but it is instead an array of addresses so you specify the addresses that will receive less due to the fee being subtracted from their amounts.

> **Comments:**
> **username_0**: ye i know about subtractfeefromamount but i need to calculate amount before(!) send, so with your example we'll understand how much we sent only after processing transaction  
> **username_1**: You can use fundrawtransaction with the subtractFeeFrom option to construct a transaction (but not sign or broadcast it). Then you can look at the amount in the output to see how much will actually be sent.  

---

