Skip to content

npub to hex converter

Paste an npub to get the hex public key, or paste a hex key to get the npub. Everything runs in your browser. Nothing is sent anywhere.

Why Nostr keys have two formats

Every Nostr identity is a keypair. The public half is what other people see, and it exists in two spellings of the same value. The raw form is 64 hexadecimal characters, which is what relays and clients use internally in every event. The human friendly form is the npub, a bech32 encoding of that same value with a readable prefix and a built in checksum.

The npub format exists because hex is easy to mistype and hard to eyeball. A single wrong character in a hex key still looks like a valid key, while an npub with a typo fails its checksum immediately. That is why clients show npubs to people and keep hex under the hood.

When you need to convert npub to hex

Plenty of tools still speak raw hex: relay admin panels, filters in scripts, NIP-05 files, and some older clients. If a config file asks for a pubkey and rejects your npub, it almost certainly wants the 64 character hex form. Going the other way, you will want the npub whenever you share your identity with a person rather than a program.

This converter detects what you pasted and converts in the right direction automatically. It also spots the difference between a public key and a private key. If you paste an nsec, the tool refuses it and tells you to keep it private, because a private key should never be pasted into a website, including this one.

Is this converter safe to use?

Yes, because conversion is pure math on a value that is already public. The bech32 encoding contains exactly the same information as the hex spelling, nothing more. The conversion happens entirely in your browser with the same open source library most Nostr clients use, and this page makes no network requests with your input. You can load it, disconnect from the internet, and it still works.

One thing a converter cannot do is tell you whether a key belongs to the person you think it does. For that, check their NIP-05 address with our address checker, or compare the key across several places you trust.

A note on formats you may also meet: nprofile strings bundle a pubkey with relay hints, and both nsec and npub share the bech32 alphabet, which is why looking at the prefix matters more than the shape. If a string starts with npub1 it is safe to share by design. If it starts with nsec1, treat it like the password to your entire identity, because that is exactly what it is.

Give your key a name

Tired of sharing a 63 character npub? Azzamo Premium includes a verified NIP-05 address at @azzamo.network, so people can find you by name.

Get Premium