<p>Usually, you want to do this to estimate a fee before sending a transaction. Transaction fees are way more complicated than they probably should be. I'll stick to calculating the transaction size here, but keep in mind there's more to the picture when talking about fees.</p>

<p><strong>in</strong> is the number of inputs, and <strong>out</strong> is the number of outputs. If you haven't seen this discussed before, here's a crash course.</p>

<p>Using a block explorer you may have noticed that some transactions use multiple inputs, even though only one address is spent from. For example:</p>

<p><a href="https://blockchain.info/tx/52a3f2ba48598da7359cfa5d7419848d358f8739aa47bcbe36413bdcb77e9194" rel="nofollow noreferrer">https://blockchain.info/tx/52a3f2ba48598da7359cfa5d7419848d358f8739aa47bcbe36413bdcb77e9194</a></p>

<p>Bitcoin is an "electronic cash system". Understanding this concept is probably the most important thing you can do as a Bitcoin user. Unfortunately, it's the part that most beginning users skip.</p>

<p>Rather than physical tokens like metal coins and paper banknotes, Bitcoin uses electronic tokens. There's more here: <a href="http://bitzuma.com/posts/bitcoin-think-of-it-as-electronic-cash/" rel="nofollow noreferrer">Bitcoin: Think of It as Electronic Cash</a>.</p>

<p>In Bitcoin, there's a useful relationship:</p>

<p>coin ≈ unspent output</p>

<p>Think of a transaction as a box. On the left are inputs. On the right are outputs. Each input links to the output of a previous transaction. An output can only be spent once, and it must be completely spent. An output with no later links to it can be spent, and is often referred to as an "unspent coin".</p>

<p><img src="https://i.sstatic.net/488D8.jpg" alt="enter image description here"></p>

<p>Each input in a simple Alice-Pays-Bob transaction contributes ~180 bytes, if you're using uncompressed public keys, and ~148 bytes if your public keys are compressed.</p>

<p>So, to estimate the size of the transaction in bytes, you need to know how many coins will be spent, and whether your public key is compressed or uncompressed.</p>

<p>Unfortunately, "consumer friendly" wallets won't show you your coins. You'll have to use a more advanced tool that supports "coin control" to do that. Bitcoin Core and Armory support coin control, as does Electrum to a limited extent.</p>

CC BY-SA 3.0
2015-06-02T14:41:17.393Z
2015-06-02T14:41:17.393Z
Rich Apodaca
<p>In the simplest typical case, you'll have one input and two outputs (the recipient, and change). So <strong>in</strong>=1 and <strong>out</strong>=2. According to the linked formula, the transaction size will be about 160+2*34+10 = 258 bytes. It does not depend on how many bitcoins you are sending.</p>

<p>However, if the money you are sending came from many different sources, you will have many inputs and the transaction will be bigger. Again, this does not depend on the amount of money, but on the complexity of your wallet's history.</p>

CC BY-SA 3.0
2015-06-10T06:07:59.733Z
**in**  =1times  = .2btc **out**=2times = 0.8btc and 0.2btc . is it right?? what is my transaction fee for that??? sorry for disturbing you.. thank you
Md Shahadat Hossain
CC BY-SA 3.0
2015-06-10T17:53:45.057Z
Usually a fee of 0.0001 bitcoin will get your transaction confirmed quickly.
Meni Rosenfeld
CC BY-SA 3.0
2015-06-11T05:29:51.750Z
i transaction many type of amount. but a amount .0002BTC i do transaction many times, it fees as 0.00012568, 0.00015528 BTC, 0.00012096 BTC. how can i calculate this value???
Md Shahadat Hossain
CC BY-SA 3.0
2015-06-11T11:28:43.970Z
@ShahadatHossain: I don't know.
Meni Rosenfeld
CC BY-SA 3.0
2015-06-02T14:24:27.240Z
2015-06-02T14:24:27.240Z
Meni Rosenfeld
<p>i have read : <a href="https://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending">How to calculate transaction size before sending</a></p>

<p>but i will not understand what are <strong>in</strong> and <strong>out</strong>.
as describe in this link <strong>in=40 and out=16</strong></p>

<p>what does it mean???</p>

<p>i will send only one address to 0.20BTC of 1BTC account.
please describe this transaction size.</p>

CC BY-SA 3.0
2015-06-03T12:47:39.493Z
This question is pretty hard to understand languagewise, could somebody that understood its intent please improve it and properly tag it?
Murch
<bitcoind><transaction-fees>
how to calculate transaction bytes of a x BTC? x=0.2
Md Shahadat Hossain
# how to calculate transaction bytes of a x BTC? x=0.2

(Asked by: username_0 on 2015-06-02)

i have read : [How to calculate transaction size before sending](https://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending)

but i will not understand what are **in** and **out**.
as describe in this link **in=40 and out=16**

what does it mean???

i will send only one address to 0.20BTC of 1BTC account.
please describe this transaction size.

**Tags:** bitcoind, transaction-fees

> **Comments:**
> **username_1**: This question is pretty hard to understand languagewise, could somebody that understood its intent please improve it and properly tag it?  

---

## 2 answers

### Answer by username_2 on 2015-06-02. Score: 2

Usually, you want to do this to estimate a fee before sending a transaction. Transaction fees are way more complicated than they probably should be. I'll stick to calculating the transaction size here, but keep in mind there's more to the picture when talking about fees.

**in** is the number of inputs, and **out** is the number of outputs. If you haven't seen this discussed before, here's a crash course.

Using a block explorer you may have noticed that some transactions use multiple inputs, even though only one address is spent from. For example:

<https://blockchain.info/tx/52a3f2ba48598da7359cfa5d7419848d358f8739aa47bcbe36413bdcb77e9194>

Bitcoin is an "electronic cash system". Understanding this concept is probably the most important thing you can do as a Bitcoin user. Unfortunately, it's the part that most beginning users skip.

Rather than physical tokens like metal coins and paper banknotes, Bitcoin uses electronic tokens. There's more here: [Bitcoin: Think of It as Electronic Cash](http://bitzuma.com/posts/bitcoin-think-of-it-as-electronic-cash/).

In Bitcoin, there's a useful relationship:

coin ≈ unspent output

Think of a transaction as a box. On the left are inputs. On the right are outputs. Each input links to the output of a previous transaction. An output can only be spent once, and it must be completely spent. An output with no later links to it can be spent, and is often referred to as an "unspent coin".

![enter image description here](https://i.sstatic.net/488D8.jpg)

Each input in a simple Alice-Pays-Bob transaction contributes ~180 bytes, if you're using uncompressed public keys, and ~148 bytes if your public keys are compressed.

So, to estimate the size of the transaction in bytes, you need to know how many coins will be spent, and whether your public key is compressed or uncompressed.

Unfortunately, "consumer friendly" wallets won't show you your coins. You'll have to use a more advanced tool that supports "coin control" to do that. Bitcoin Core and Armory support coin control, as does Electrum to a limited extent.


---

### Answer by username_3 on 2015-06-02. Score: 2

In the simplest typical case, you'll have one input and two outputs (the recipient, and change). So **in**=1 and **out**=2. According to the linked formula, the transaction size will be about 160+2\*34+10 = 258 bytes. It does not depend on how many bitcoins you are sending.

However, if the money you are sending came from many different sources, you will have many inputs and the transaction will be bigger. Again, this does not depend on the amount of money, but on the complexity of your wallet's history.

> **Comments:**
> **username_0**: **in**  =1times  = .2btc **out**=2times = 0.8btc and 0.2btc . is it right?? what is my transaction fee for that??? sorry for disturbing you.. thank you  
> **username_3**: Usually a fee of 0.0001 bitcoin will get your transaction confirmed quickly.  
> **username_0**: i transaction many type of amount. but a amount .0002BTC i do transaction many times, it fees as 0.00012568, 0.00015528 BTC, 0.00012096 BTC. how can i calculate this value???  
> **username_3**: @ShahadatHossain: I don't know.  

---

