• Hash256
  • Hash160
  • Reverse Bytes

Bits The target in a compact format.

The bits field is a compact way of storing the target in the block header.


Here's what the target was when Block 406,800 was mined:

Target: 0x00000000000000000696f4000000000000000000000000000000000000000000

And this is the Bits field you'll find in the block header for it:

Bits: 0x180696f4

Converting Bits

Bits is just a shorthand version of the Target.

It looks alien at first, but it's basically split in to two parts:

  1. Exponent: This gives you the size of the target in bytes.
  2. Coefficient: This gives you the initial 3 bytes of the target.

I think of it as using the exponent to calculate how many zeros to write down, then I replace the first 3 bytes with the coefficient.

So if you want to find out what the Target was when a block was mined, the Bits field will help you work out the (slightly rounded up) value of it.

Bits -> Target

Remember that the exponent is a hexadecimal number, so 0x18 means that's 24 bytes in decimal.

The coefficient part taken from the original target is always rounded up. Here's the current target.

The full target is often shown as 32 bytes in length, which is where all those preceeding zeros come in. But really all of the following are the same number:

Target: 0x00000000000000000696f4000000000000000000000000000000000000000000
Target: 0x0696f4000000000000000000000000000000000000000000
Target: 0x696f4000000000000000000000000000000000000000000

Why have "Bits"?

Question: Why ever would you convert the Target in to "Bits"? Why not just store the full Target in the block header?

Answer: Because the block header doesn't need to store the absolute precision of the full Target, so the Bits format saves on space.

By Greg Walker,

Last Updated: 24 May 2019
  • 24 May 2019: Added Hashover comment system (basic functionality to test it out)
  • 26 Nov 2018: Added sub titles to every page.
  • 25 Nov 2018: Subtitles for pages in Glossary. Looks good.
  • 13 May 2017: Ajax Tooltips - wrap <span data-tip="txid"> around anything and it will grab the description from the yaml:tip in a glossary page
  • 24 Feb 2017: CSS - glossary pages now use .center instead of .title for images inside figures
  • 20 Jan 2017: - updated diagram to something more exact
  • 20 Jan 2017: - Rewrote, because target adjusts by itself, not from an internal difficulty value. Also added a handy svg diagram.
  • 13 Jan 2017: tidied up glossary pages - css, formatting, restructuring
  • 02 Jan 2017: Added target tooltip above blockhash on block.php and candidatblock.php when hovering over the Bits field in the block header.
  • 01 Jan 2017: Moved /manual/guide/ and /manual/reference/ to /guide/ and /glossary/

Hey there, it's Greg.

I'll let you know about cool website updates, or if something seriously interesting happens in bitcoin.

Don't worry, it doesn't happen very often.