Private Key Tools

Binary private key โ†’ HEX, WIF and addresses

Enter the private key as 256 bits of 0/1 โ€” spaces, newlines, colons and underscores are ignored โ€” and watch the bits regroup into bytes, a HEX key, both WIFs, both public keys and all ten addresses. This is the view where you can see exactly which bit does what.

Up to 256 characters of 0/1. Spaces, tabs, newlines, colons, dashes and underscores are stripped first, so a key pasted in byte groups is fine. Shorter input is left-padded to a whole number of bytes, then to 32 bytes โ€” 1 is the key 1. More than 256 bits is rejected.
No input yet

Enter a value above and press Convert. Not sure what to type? Press โ€œUse exampleโ€ to load the sample from the placeholder.

How it works

What this page computes

This page accepts the private key as raw bits โ€” up to 256 characters of 0 and 1 โ€” and shows what every one of those bits does. Spaces, tabs, newlines, colons, dashes and underscores are ignored, so you can paste a key in whatever layout your source used. The bits are then regrouped into bytes, converted to hex, and the full derivation runs from there.

bits โ†’ bytes (8 bits each) โ†’ hex (2 digits each) โ†’ k โ†’ P = k ยท G โ†’ addresses
256 bits of 0/1โ†’ strip separatorsโ†’ pad left to a byte boundaryโ†’ 32-byte hex keyโ†’ WIF + public keysโ†’ 10 addresses

This is the only page in the set where you can see which bit produces which address, because binary is the one representation that does not hide the machine's own unit of work.

1. Bit, nibble, byte, word

The units matter because every conversion on this page is a regrouping of the same bits:

UnitSizeWritten asIn a 256-bit key
bit10 or 1256 of them
nibble (half-byte)4 bitsone hex digit 0โ€“f64 of them
byte (octet)8 bitstwo hex digits, e.g. 0832 of them
32-bit word32 bits8 hex digits8 of them
the whole key256 bits64 hex digits / 32 bytes1

The relationship is exact and has no remainder: 8 bits are always 2 hex digits, 4 bits are always 1, and 256 divides evenly by both. That is the entire reason hexadecimal exists in this domain โ€” it is a lossless human-readable view of binary, not a separate number system with its own rules.

2. Binary โ†’ hex, digit pair by digit pair

The conversion is done by nibble grouping, and it never requires arithmetic on the whole number:

for each group of 4 bits (left to right):
    value = 8*b3 + 4*b2 + 2*b1 + 1*b0      # 0..15
    emit  "0123456789abcdef"[value]

Applied to the demo key's first four bytes:

bits   0000 1000 0010 0100 1100 0011 0001 0100
hex      0    8    2    4    c    3    1    4
                 โ†‘
        byte 0 = 0x08 ยท byte 1 = 0x24 ยท byte 2 = 0xc3 ยท byte 3 = 0x14
4-bit groupValueHex digit4-bit groupValueHex digit
000000100088
000111100199
001022101010a
001133101111b
010044110012c
010155110113d
011066111014e
011177111115f

Note that this page pads your input on the left to the next byte boundary before converting, and then the key validator pads again to a full 32 bytes. Typing 1 is therefore the key 1 โ€” not 0x10, and not an error. Left is the most-significant end, and that is the rule for every fixed-width integer in Bitcoin key material.

3. Big-endian and little-endian

"Endianness" is only a question when a multi-byte value is written to a byte sequence: do the significant bytes come first or last? Bitcoin is famously inconsistent about it, and the inconsistency is a top source of interoperability bugs.

FieldByte orderWhy it matters to you
Private key (32 bytes), public key X/Y, hash160, x-only Taproot keyBig-endianHex as written is the number as written. No reversal, ever.
WIF payload, BIP32 extended key material, BIP39 seedBig-endianCopy the bytes in order; the address/WIF arithmetic depends on it.
Transaction versionLittle-endian (int32)Byte 1 of a raw tx is the low byte of the version
Transaction input/output counts and script lengthsVarInt (CompactSize), little-endian01 means "one input" only for small counts; โ‰ฅ 0xfd uses a prefix
Outpoint transaction id as serializedLittle-endian (reversed from display)What an explorer shows as 3a1bโ€ฆ is stored โ€ฆ1b3a
Output amounts (satoshis, int64)Little-endian1 BTC = 100000000 satoshis, written low byte first
Block header version, timestamp, bits, nonceLittle-endian (uint32)Mining and header parsing both depend on this
Proof-of-work block hashes as displayedBig-endian (reversed from the internal hash)The famous leading zeros of a block hash are the end of the internal byte order
Bech32 data words5-bit groups, most-significant bit firstThe 8โ†’5 bit regrouping is why bc1 addresses are longer than the program they carry
The two-line rule that prevents most endianness bugs

Key material (private keys, public keys, hashes used in addresses, seeds) is big-endian โ€” the way you see it is the way it is. Consensus serialization (amounts, indexes, versions, lengths) is little-endian. If you find yourself reversing bytes while deriving an address, you have almost certainly made a mistake; if you find yourself not reversing while parsing a raw transaction, you probably have too.

4. Why leading zeros carry meaning

In ordinary arithmetic 0001 and 1 are the same number, and many programming languages will happily agree. In a serialized key they are not the same bytes, and the byte count is fixed by the protocol at 32. A key's leading zeros are therefore data: they say "this key is small", and dropping them shifts every following bit to the left.

Key (decimal)Hex, 64 digitsLeading zero bitsResult of dropping the zeros
100000000000000000000000000000000000000000000000000000000000000012551 โ€” accidentally still correct, but only because the padding is restored
2560000000000000000000000000000000000000000000000000000000000000100247100 in hex = 256 โ€ฆ or 100 in decimal = 256: reading the same digits in the wrong base is the other classic disaster
225580000000000000000000000000000000000000000000000000000000000000000A single dropped zero halves the value; the address changes completely
demo key0824c314772b2c2859c889471390a36bf66e53a1ca1642f96f0f2c9307a171ca4824c314โ€ฆ is a different 32-byte key (its first byte would become 0x82)

The demo key illustrates the subtlety: it has 0 leading zero bytes but 4 leading zero bits, because its first byte is 0x08. Both counts are reported on this page, and mixing them up is the most common mistake when people hand-type binary keys.

5. Entropy, bit balance and Hamming weight

The Hamming weight of a key is simply how many of its 256 bits are 1. For a uniformly random key each bit is an independent fair coin, so the weight follows a binomial distribution with mean and spread:

E[weight] = 256 ร— 0.5 = 128   ฯƒ = โˆš(256 ร— 0.5 ร— 0.5) = 8

So roughly 68 % of random keys land in 120โ€“136, and 99.7 % in 104โ€“152. The demo key's weight is 116 โ€” 1.5 ฯƒ below the mean, entirely unremarkable. What matters is that you did not choose it: a key with a deliberately balanced weight has less than 256 bits of entropy, because you excluded most of the space.

Bit patternHamming weightValid key?Practical status
all zeros (256 ร— 0)0nok = 0 is the point at infinity; rejected with "Private key 0 is invalid"
a single 1 in the last position1yesk = 1; its P2PKH address is 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH and is empty because everyone watching drained it years ago
a single 1 in the first position1yesk = 2255 = 57896044618658097711785492504343953926634992332820282019728792003956564819968, address 18h7RmwXCTYX69z9S2Hc9gs8ET7SUN7YG5 โ€” "large" is not "strong"
demo key116yesIndistinguishable from random
all ones (256 ร— 1)256no2256โˆ’1 exceeds the curve order n; rejected
"Balanced bits" is not a security property

People occasionally "improve" a key by flipping bits until exactly half are ones. That destroys entropy: the set of 256-bit strings with exactly 128 ones has C(256,128) โ‰ˆ 2251.6 members, so the balanced-key space is about 20 times smaller than the full space โ€” and far more importantly, an attacker who guesses that you did this gets to skip every unbalanced key. Uniform randomness from a CSPRNG is the only correct construction; any human "adjustment" is a reduction.

6. How key-search programs exploit known bit patterns

Brute force against a full 256-bit key is hopeless: 2256 candidates. Search programs do not attack random keys; they attack keys whose shape is known. Three shapes are common, and all three are visible in the binary representation of a key:

What is known about the keyCandidate spaceCost with the best general algorithm
Nothing (uniformly random 256-bit key)2256โ‰ˆ 2128 group operations (Pollard's rho) โ€” infeasible
Top t bits are zero, i.e. k < 2256โˆ’t2256โˆ’tโ‰ˆ 2(256โˆ’t)/2 point additions (Pollard's kangaroo), plus memory for BSGS
An exact range [a, b] of width wwโ‰ˆ โˆšw point additions โ€” this is why interval keys ("puzzle" keys) fall first
Bottom t bits are zero, i.e. k is a multiple of 2t2256โˆ’tThe same kangaroo bound, after dividing through by 2t
A human-recognisable pattern (a repeated byte, a counter, a date)as small as you can guessDictionary/enumeration: seconds to hours

Concretely: a key with the top 128 bits known to be zero leaves 2128 candidates and costs about 264 point additions โ€” still out of reach today. A key with the top 200 bits zero leaves 256 candidates, about 228 โ‰ˆ 268 million additions: a single GPU for minutes. That is the actual reason the well-known "puzzle" addresses are emptied so quickly โ€” their keys are known to be small, so the search is over an interval, not over the space.

A key you can describe in words is a key someone else can find

Any rule that shrinks the search space โ€” "256 bits but only the last 64 matter", "it's a famous constant", "I typed 1 and pressed 0 forty times" โ€” reduces your security from 256 bits to whatever the rule leaves. And because Bitcoin addresses are public and permanently watchable, an attacker does not even need to be fast in absolute terms: they need to be faster than you are at spending. Keys built from patterns are swept in the same block as the deposit.

7. Worked example

The 256 bits below are the demo key, and every hex, WIF and address value in this table is produced live by this page:

StepValue
Bits (first 64 of 256)00001000 00100100 11000011 00010100 01110111 00101011 00101100 00101000
Bit length / byte length256 bits / 32 bytes / 64 hex digits
Hamning weight (ones)116 (mean 128, ฯƒ 8 โ†’ 1.5 ฯƒ low)
Leading zero bits / trailing zero bits4 / 1
HEX key0824c314772b2c2859c889471390a36bf66e53a1ca1642f96f0f2c9307a171ca
Decimal3683455675284633286911943861444039993120875154046227415438637967083965608394
Compressed WIFKwVYL77Lcs1ckM39NvGjrtfKhU4KKdR2iB9Wq2FSMN6rbGK5tVqG
Compressed public key02ff812e26116a9aa140abe629e7f8a38401653caf925119def59ed3758c67ee80
hash160 (compressed)21f57b6debcfc5b67182dfb4af1641f0a8189012
P2PKH (C)146ZNjH7XTXnMd1ofe3z7CL2i8WM7N2UqT
P2SH-P2WPKH (S)3DZT76KyKyc5zkzvLugP8umgt4RPY4XPQw
P2WPKH (W)bc1qy86hkm0telzmvuvzm76279jp7z5p3yqjnaerk6
P2TR (T)bc1pmsrhxnvmj8tjxxu9wj69ntvwvhvr28qufyc26tshz3rjj777tx3sh54u63

Two facts worth internalising from this table. First, flipping the final 0 bit to 1 would change the private key by one, and would change every single derived value โ€” the public key, both hashes and all ten addresses โ€” beyond recognition. There is no "almost the same key" in Bitcoin. Second, the visual structure of the bits (00001000 00100100 โ€ฆ) tells you nothing about the address: the mapping from bits to address is deliberately unstructured, which is what stops an attacker from searching "nice-looking" keys instead of the whole space.

8. What comes next in the chain

9. Security notes

10. Common mistakes

11. Quick reference

ItemValue / rule
Input1โ€“256 characters of 0/1; spaces, newlines, colons, dashes and underscores ignored
Rejected inputany other character (Not a valid binary string), or more than 256 bits (Binary input exceeds 256 bits)
Short inputPadded on the left to a byte boundary, then to 32 bytes โ€” 1 is the key 1
Valid key range1 โ€ฆ nโˆ’1; all-zeros and all-ones are both invalid
Expected Hamming weight128 ยฑ 8 for random keys (demo key: 116)
Byte order of key materialBig-endian (most significant byte first)
Byte order of consensus dataLittle-endian (amounts, indexes, versions, lengths)
Reversible?Bits โ‡„ hex โ‡„ decimal is lossless; key โ†’ address is not