Private Key Tools

Base64 private key → HEX, WIF, addresses

Paste a Base64-encoded 32-byte private key and get the decoded HEX, the decoded byte length, both WIFs, both public keys, the hash160 and all five address types. Base64 is a transport encoding with no checksum, so this page checks the decoded length before it trusts anything.

Standard Base64 (A–Z a–z 0–9 + /) with optional = padding. Whitespace is ignored, so a wrapped paste works. The result must decode to exactly 32 bytes; anything longer is rejected rather than truncated. Not the same thing as a Base58 WIF.
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

Some wallets, exchanges and OpenSSL-based tools never show a private key as 64 hex digits. They print the raw 32 bytes as Base64, because Base64 survives any text-only channel: JSON, INI files, chat messages, QR codes, clipboards. This page reverses that step — decode the text back into bytes, check that the result really is one valid secp256k1 private key, then run the whole derivation chain on it.

Base64 length = 4 · ⌈n / 3⌉  characters, for n input bytes
Base64 text→ 6-bit groups→ raw bytes→ 32-byte key k→ WIF / public keys→ addresses

It never guesses: a decoded length that is not 32 bytes is an error, and an empty box produces an empty state rather than a result.

1. The Base64 alphabet, and why it holds 64 symbols

A private key is 32 bytes, and a byte can hold any of 256 values — roughly half of them control characters, quotes or bytes that are simply illegal in a text protocol. Base64 avoids all of that by re-grouping the bits into 6-bit chunks and mapping each chunk onto one of 64 harmless printable characters.

Why 64? Because 26 = 64, and 6 bits is the largest chunk that still maps onto printable ASCII: 7 bits would need 128 symbols, and most of the upper range is control codes. The alphabet is fixed and public, and one character means one 6-bit value — nothing more:

IndexCharactersCountNote
0 – 25A … Z26upper case
26 – 51a … z26so A ≠ a
52 – 610 … 910digits
62+1breaks URLs
63/1breaks file paths
—=—not a symbol: a padding marker

26 + 26 + 10 + 1 + 1 = 64. Every 6-bit value from 000000 to 111111 has exactly one character, and every character has exactly one value. That is the entire trick.

2. Four characters carry three bytes — and where = comes from

6 bits per character and 8 bits per byte do not line up. The smallest common multiple is 24 bits: 24 = 3 bytes = 4 Base64 characters. Base64 therefore always processes input in 3-byte blocks and emits 4 characters per block, wasting no bits anywhere in the middle of the stream.

A 32-byte key is not a multiple of 3, so the final block is short and has to be padded. The arithmetic for the demo key is:

n = 32 bytes
full blocks = floor(32 / 3) = 10       -> 10 × 4 = 40 characters
leftover    = 32 mod 3      = 2 bytes  -> needs ceil(2·8 / 6) = 3 characters
padding     = 4 − 3         = 1        -> one "=" marker
total       = 40 + 3 + 1    = 44 characters = 4 · ⌈32/3⌉

That matches the sample exactly: 44 characters, ending in a single =.

InputExampleEncodedPaddingChars
1 byte01AQ==2 × =4
2 bytes0102AQI=1 × =4
3 bytes010203AQIDnone4
20 bytes (hash160)21f57b6d…189012IfV7bevPxbZxgt+0rxZB8KgYkBI=1 × =28
32 bytes (a key)this page's demo keyCCTDFHcr…ehcco=1 × =44
33 byteskey + one extra byte—none44

The last two rows matter: a 32-byte and a 33-byte blob both encode to 44 characters. Only the = count separates them — one pad means n mod 3 = 2, none means n mod 3 = 0. Characters alone never reveal the byte length.

Reading the length like a decoder does

Base64 length is always a multiple of 4, and the trailing = count recovers n mod 3: 0 pads → n ≡ 0, 1 pad → n ≡ 2, 2 pads → n ≡ 1. The decoded byte length is therefore known before decoding — and it is reported as a result here, because a private key must decode to exactly 32 bytes.

3. An encoding is neither encryption nor compression

overhead = 4·⌈n/3⌉ / n − 1 = +33.3 % (large n)  →  +37.5 % for a 32-byte key (44 chars vs 32 bytes)
Representation of the same 32-byte keyCharactersSize vs raw bytesBits per character
Raw bytes32 bytes1.00× (baseline)8
Base64441.375× (+37.5 %)6
Hex642.00× (+100 %)4
Base58 (bare)431.344× (+34.4 %)≈5.858
WIF compressed (Base58Check)521.625× (+62.5 %)≈5.858

For this key size Base64 is the tightest text alphabet — 44 characters against 64 for hex — yet still 37.5 % larger than the raw bytes. It buys nothing in security, everything in compatibility.

4. Base64 next to hex, Base58 and Bech32

Bitcoin's ecosystem uses four text alphabets, and picking the wrong decoder is one of the most common ways to end up with a "key" no wallet recognises.

Base64HexBase58 / Base58CheckBech32 / Bech32m
Alphabet size64165832
SymbolsA–Z a–z 0–9 + /0–9 a–f1–9 A–Z a–z minus 0 O I lqpzry9x8gf2tvdw0s3jn54khce6mua7l
Bits per character64≈5.8585
Case sensitivityYesNoYesNo, but mixed case is forbidden
ChecksumNoneNoneOnly in the Check variant (4 bytes of SHA256d)Yes — a 6-character BCH code
Typo detectionNone — a wrong character silently gives different bytesNoneRejects almost every typoUp to 4 errors detected, 2 located
Typical usePEM/DER files, JSON config, API exportsBIP test vectors, debug dumpsLegacy addresses, WIFSegWit addresses

5. Where a Base64 private key actually comes from

Bitcoin Core itself exports WIF, not Base64. Base64 keys appear in the seams between Bitcoin and general-purpose software:

A Base64 blob is often not a key at all

If a string decodes to 300 bytes it is a PEM/DER key file, a keystore or a backup archive, not a raw 32-byte scalar. This page therefore enforces an exact length and refuses anything longer than 32 bytes rather than truncating it into a valid-looking key that controls something else.

6. Worked example — the demo key in every representation

These are the values this page produces for the sample Base64 in the input box:

StepValue
Base64 input (44 chars, one =)CCTDFHcrLChZyIlHE5Cja/ZuU6HKFkL5bw8skwehcco=
Decoded hex (64 digits)0824c314772b2c2859c889471390a36bf66e53a1ca1642f96f0f2c9307a171ca
Decoded length32 bytes = 256 bits
Padding characters1 → consistent with 32 mod 3 = 2
Re-encoded Base64CCTDFHcrLChZyIlHE5Cja/ZuU6HKFkL5bw8skwehcco= — identical, so nothing was lost
WIF, compressedKwVYL77Lcs1ckM39NvGjrtfKhU4KKdR2iB9Wq2FSMN6rbGK5tVqG
WIF, uncompressed5HssbguBnjbaUVZCsH9YuzUG7T4vYQf51iiodi4izdVy6aVNekU
P2PKH address146ZNjH7XTXnMd1ofe3z7CL2i8WM7N2UqT
P2WPKH addressbc1qy86hkm0telzmvuvzm76279jp7z5p3yqjnaerk6

Now change exactly one character — the leading C becomes a 0. Both are legal Base64 symbols, so the decoder has nothing to complain about:

Original — CC…

CCTDFHcrLChZyIlHE5Cja/ZuU6HKFkL5bw8skwehcco=

decodes to 0824c314…171ca, P2PKH 146ZNjH7XTXnMd1ofe3z7CL2i8WM7N2UqT

One character different — 0C…

0CTDFHcrLChZyIlHE5Cja/ZuU6HKFkL5bw8skwehcco=

decodes to d024c314…171ca, P2PKH 1HW3HfyXS3UFRJDMQ5LJjVyk12UMf6uoGB

The first byte moved from 08 to d0, and the key, both WIFs and every address changed with it. Base64 flagged nothing.

Base64 has no checksum — a typo is a different key

Base58Check and Bech32 carry a checksum inside the string, so a single mistyped character is caught at once (a WIF simply refuses to decode). Base64 carries nothing: one wrong character produces a perfectly valid different private key, and the first you hear of it is an empty wallet. Before moving funds to an address derived from a Base64 export, re-encode the decoded bytes and compare the two strings.

7. Base64 and WIF are not two spellings of the same thing

Both are text encodings of one 32-byte secret, and that is where the similarity ends. A WIF is Base58Check(0x80 ‖ key ‖ 0x01): it adds a version byte naming the network, a flag byte saying whether the key is used in compressed form, and a 4-byte double-SHA256 checksum. Base64 adds padding and nothing else.

Form of the demo keyAlphabetVersion byteCompression flagChecksumLength
Hex16——none64
Base6464——none44
WIF uncompressed580x80absent4 bytes51
WIF compressed580x800x014 bytes52

The alphabets are the practical test. Base58 excludes 0, O, I and l so that handwritten paper wallets cannot be misread, and it excludes +, / and = as well. Base64 uses all of those. So a string containing +, / or = is not a WIF, and a string containing 0, O, I or l is not Base58 at all.

The reverse test is the dangerous one. Every Base58 character is also a legal Base64 character, and a compressed WIF is 52 characters — exactly divisible by 4. Paste KwVYL77Lcs1ckM39NvGjrtfKhU4KKdR2iB9Wq2FSMN6rbGK5tVqG into a Base64 decoder and nothing errors: it produces 39 bytes. Hence the length check here, and hence the byte count being a first-class result. A Base64 box that accepted a WIF would hand you a 39-byte "private key" that is not your key.

8. What this page rejects, and why

InputResultReason
CCTDFHcr…ehcco=accepted44 chars, 1 pad, decodes to exactly 32 bytes
CCTDFHcr…ehcco (padding stripped)acceptedtrailing padding is optional in most decoders; the page re-encodes canonically
CCTDFHcr…ehcco==rejectedat most two =, and only at the very end
CCTDFHcr…cc=orejectedpadding in the middle
CCTDFHcr…cc!rejectedcharacter outside the 64-symbol alphabet
…cc-cc_= (base64url)rejectedURL-safe Base64 swaps +// for -/_: a different alphabet
spaces or newlines insideacceptedwhitespace is stripped first, so a wrapped paste works
33 or 34 decoded bytesrejecteda raw private key is exactly 32 bytes
a WIF pasted hererejecteddecodes to 39 or 38 bytes — recognised and refused instead of mangled
a hash160 (20 bytes)rejectedtoo short: that is a public-key hash

One subtlety: Base64 is not injective. In a partial final block the bits that do not fit are ignored, so for a 32-byte key …ehcco= and …ehccp= decode to identical bytes even though the strings differ, and decoders accept both. Never compare two Base64 keys as strings — decode first, then compare bytes.

9. Security notes and common mistakes

10. Quick reference

ItemValue
Decoded lengthmust be exactly 32 bytes (256 bits)
AlphabetA–Z a–z 0–9 + /, = as padding
Length formula4 · ⌈n/3⌉, always a multiple of 4
Padding rulen mod 3 = 0 → none, 1 → two, 2 → one
Size for a 32-byte key44 characters, +37.5 % over the raw bytes
Checksumnone — typos are undetectable
Encryption / compressionneither: it is a reversible transport encoding