<p>Starting with Bitcoin Core 24.0.0 you can use the <a href="https://bitcoincore.org/en/doc/24.0.0/rpc/wallet/sendall/" rel="nofollow noreferrer"><code>sendall</code></a> RPC:</p>
<p>E.g.</p>
<pre><code>bitcoin-cli -named sendall recipients='[&quot;&lt;bitcoinaddress&gt;&quot;]' fee_rate=&lt;sat/vB&gt;
</code></pre>
<p>Note that <code>sendall</code> will spend all of your UTXOs by default, including UTXOs that cannot pay for their own input weight. If you would like to maximize the funds received to the recipient address by not spending uneconomical UTXOs, use the <code>send_max</code> option.</p>
<pre><code>bitcoin-cli -named sendall recipients='[&quot;&lt;bitcoinaddress&gt;&quot;]' fee_rate=&lt;sat/vB&gt; send_max=true
</code></pre>
<p>RPC Documentation here: <a href="https://bitcoincore.org/en/doc/24.0.0/rpc/wallet/sendall/" rel="nofollow noreferrer">https://bitcoincore.org/en/doc/24.0.0/rpc/wallet/sendall/</a></p>

CC BY-SA 4.0
2023-07-17T19:49:35.790Z
2023-07-17T19:56:54.150Z
2023-07-17T19:56:54.150Z
Murch
<p>To be strict, OP asked to send <strong>all</strong> coins, which @michael.schuett didn't answer.</p>
<p>The key thing to do this is the last optional bool argument of the <code>sendtoaddress</code> RPC command called <code>subtractfeefromamount</code>. The way to use it is:</p>
<pre><code>bitcoin-cli walletpassphrase &lt;passphrase&gt; &lt;timeoutInSeconds&gt;
bitcoin-cli sendtoaddress &lt;bitcoinaddress&gt; `bitcoin-cli getbalance` &quot;&quot; &quot;&quot; true
</code></pre>

CC BY-SA 4.0
2016-12-16T02:12:28.093Z
2023-07-17T06:54:51.510Z
2023-07-17T06:54:51.510Z
knocte
<p>This command:</p>

<p><code>sendtoaddress &lt;bitcoinaddress&gt; &lt;amount&gt;</code> </p>

<p>will do the trick.</p>

<p>Look at the bitcoind api for more info: <a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list</a></p>

CC BY-SA 3.0
2014-01-06T21:37:57.267Z
2017-07-04T15:17:48.180Z
2017-07-04T15:17:48.180Z
michael.schuett
<p>I'm running bitcoind and I want to send all my coins to another address. What is the command for this? </p>

<bitcoind>
What is the bitcoind command to send all coins to another address?
Patoshi パトシ
# What is the bitcoind command to send all coins to another address?

(Asked by: username_0 on 2014-01-06)

I'm running bitcoind and I want to send all my coins to another address. What is the command for this?

**Tags:** bitcoind


---

## 3 answers

### Answer by username_1 on 2023-07-17. Score: 1 | Accepted answer

Starting with Bitcoin Core 24.0.0 you can use the sendall RPC:
E.g.
bitcoin-cli -named sendall recipients='[""]' fee_rate=

Note that sendall will spend all of your UTXOs by default, including UTXOs that cannot pay for their own input weight. If you would like to maximize the funds received to the recipient address by not spending uneconomical UTXOs, use the send_max option.
bitcoin-cli -named sendall recipients='[""]' fee_rate= send_max=true

RPC Documentation here: https://bitcoincore.org/en/doc/24.0.0/rpc/wallet/sendall/


---

### Answer by username_2 on 2016-12-16. Score: 27

To be strict, OP asked to send all coins, which @username_3 didn't answer.
The key thing to do this is the last optional bool argument of the sendtoaddress RPC command called subtractfeefromamount. The way to use it is:
bitcoin-cli walletpassphrase  
bitcoin-cli sendtoaddress  `bitcoin-cli getbalance` "" "" true


---

### Answer by username_3 on 2014-01-06. Score: 5

This command:

`sendtoaddress`

will do the trick.

Look at the bitcoind api for more info: <https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list>


---

