<p>The amount is encoded as a little endian signed 64 bits integer.</p>
<p>Here is how you would decode your sample in Python:</p>
<pre><code>&gt;&gt;&gt; int.from_bytes(bytes.fromhex(&quot;f0ca052a01000000&quot;), &quot;little&quot;)
4999990000
</code></pre>

CC BY-SA 4.0
2020-08-20T13:57:37.217Z
2020-08-20T13:57:37.217Z
Antoine Poinsot
<p>how exactly is the satoshi value in a raw transaction calculated to decimal? Because on blockchain.info, I cannot figure out how they parse the raw transaction from that value to the JSON result. I thought it would be just a hex to decimal parsing, but I cannot get the same results. Neither I understand it in here, how you get to 49.99990000 BTC (from <a href="https://developer.bitcoin.org/reference/transactions.html" rel="nofollow noreferrer">https://developer.bitcoin.org/reference/transactions.html</a>):<a href="https://i.sstatic.net/jRzdT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jRzdT.png" alt="" /></a></p>
<p>Sorry if it's a silly question.</p>

<transactions><raw-transaction><output>
Transaction parsing - Satoshi value
anne1234
# Transaction parsing - Satoshi value

(Asked by: username_0 on 2020-08-20)

how exactly is the satoshi value in a raw transaction calculated to decimal? Because on blockchain.info, I cannot figure out how they parse the raw transaction from that value to the JSON result. I thought it would be just a hex to decimal parsing, but I cannot get the same results. Neither I understand it in here, how you get to 49.99990000 BTC (from <https://developer.bitcoin.org/reference/transactions.html>):[![](https://i.sstatic.net/jRzdT.png)](https://i.sstatic.net/jRzdT.png)

Sorry if it's a silly question.

**Tags:** transactions, raw-transaction, output


---

## 1 answers

### Answer by username_1 on 2020-08-20. Score: 1 | Accepted answer

The amount is encoded as a little endian signed 64 bits integer.

Here is how you would decode your sample in Python:

```
>>> int.from_bytes(bytes.fromhex("f0ca052a01000000"), "little")
4999990000

```


---

