EasyWebTools

Free Nostr Keypair Generator Online

Generate and convert Nostr keys with educational onboarding and built-in security

What the Nostr Keypair Generator Does

On traditional social platforms, a company owns your account. They issue your username, control your data, and can suspend or delete your presence at any time. Nostr takes a fundamentally different approach: your identity is a cryptographic keypair that you generate and control. No company issues it, no company can revoke it, and no one can impersonate you without your private key.

Our Nostr Keypair Generator creates that identity for you in seconds. It produces a complete keypair consisting of a public key (npub) for sharing and a private key (nsec) that proves you are who you say you are. It also provides both keys in raw hex format for developers working at the protocol level. Beyond generation, the tool includes a format converter that translates between bech32 (nsec/npub) and hex representations instantly.

Everything runs 100% client-side in your browser. Your keys are generated using your device’s cryptographic random number generator and never touch a server. No data is transmitted, no keys are stored, and no account is required. You can disconnect from the internet before generating keys, and the tool works exactly the same.

How It Works

The tool opens with two modes at the top: Generate Keys and Convert Keys. Select the mode you need and follow the steps below.

Generating a new keypair:

  1. Click the Generate New Keypair button. The tool uses the audited @noble/secp256k1 library and your browser’s crypto.getRandomValues() to produce a cryptographically secure private key, then derives the corresponding public key.
  2. Four key outputs appear: your Public Key (npub), Private Key (nsec), Public Key (hex), and Private Key (hex). Private keys are masked by default — you must click the Reveal button to display them, protecting against shoulder surfing.
  3. Each key field includes a Copy button for quick clipboard access. A brief “Copied!” confirmation appears after each copy.
  4. An npub QR code is generated automatically on the right side of the output panel. Use the Download PNG button to save a high-resolution version for sharing. No QR code is generated for private keys — this is intentional, since a photograph of a private key QR code would compromise your identity.
  5. A red security warning reminds you to back up your nsec immediately before leaving the page.
  6. Below the output, a Getting Started with Nostr section walks you through backing up your key, installing a signing extension like Alby or nos2x, choosing a client app (Damus, Amethyst, Primal, Iris, Snort, or Coracle), and connecting to relays.

Converting an existing key:

  1. Switch to the Convert Keys tab and paste any Nostr key into the input field — nsec, npub, or a 64-character hex string.
  2. The tool auto-detects the format. For hex input, a toggle appears asking whether to treat it as a private or public key.
  3. Conversion results display instantly. Pasting an nsec returns the hex private key, the derived npub, and the hex public key. Pasting an npub returns the hex public key. Pasting a hex key returns the bech32 equivalent (and the derived public key if the input is a private key).
  4. Checksums are validated automatically — if you paste a malformed or corrupted key, a clear error message tells you what went wrong.

Why Use Our Nostr Keypair Generator

No signup, no tracking, no limits. Generate as many keypairs as you want without creating an account or handing over personal information. There are no daily caps and no premium tiers.

Security-first design. Private keys are masked on screen until you explicitly reveal them. QR codes are limited to public keys only. The underlying cryptography uses the same secp256k1 curve that secures Bitcoin, implemented through the audited @noble/secp256k1 library.

Built-in format conversion. Most Nostr tools only generate keys. Ours also converts between bech32 and hex in both directions, with automatic format detection and checksum validation. No need to switch to a separate converter.

Educational onboarding. The tool does not just hand you a key and leave you guessing. It includes a step-by-step guide to backing up your key, installing a signer, choosing a client, and connecting to relays — everything you need to go from “I have keys” to “I am on Nostr.”

Completely offline-capable. Once the page loads, the cryptographic libraries run entirely in your browser. You can disconnect from the internet, generate keys, and copy them without any network dependency.

Use Cases

Getting started with Nostr. You have heard about decentralized social networking and want to create your first identity. Generate a keypair, back up your nsec, and follow the onboarding guide to join the network in minutes.

Creating a dedicated posting identity. Many Nostr users maintain separate identities for different purposes — a personal account, a project account, a pseudonymous account. Generate a fresh keypair for each without linking them to your real name or email.

Converting keys for development. You are building a Nostr client, relay, or bot and need to translate between bech32 and hex formats for protocol-level work. Paste any key and get the equivalent representation instantly, with checksum validation included.

Sharing your identity at events. Download the npub QR code as a high-resolution PNG and print it on a badge, business card, or slide deck. Anyone at a meetup or conference can scan it to follow you on Nostr.

Verifying a key before importing. Before pasting an nsec into a new client app, run it through the converter to confirm it produces the npub you expect. This catches clipboard errors, truncation issues, and corrupted keys before they cause problems.

Offline key generation for maximum security. Load the tool, disconnect your device from the network, generate your keypair, write down the nsec on paper, and close the browser. The keys never exist on a connected device.

Tips and Best Practices

Back up your nsec before you do anything else. There is no “forgot password” flow on Nostr. If you lose your private key, your identity is gone permanently. Save it in a password manager, write it on paper stored in a secure location, or both.

Use a signing extension for daily browsing. Tools like Alby and nos2x hold your nsec securely and sign events on your behalf without exposing the raw key to websites. Reserve direct nsec entry for initial setup and backup verification only.

Never generate a QR code for your private key. A photograph, screenshot, or even a passing glance at a private key QR code is enough to steal your identity. This tool deliberately omits private key QR codes for that reason. If another tool offers one, treat it as a red flag.

Connect to multiple relays for redundancy. Relays are the servers that carry your Nostr messages. If you connect to only one and it goes offline, your posts become unreachable. Start with five to ten relays and adjust based on performance. Browse a live directory at nostr.watch to find relays with strong uptime.

Verify your keypair after generating. Switch to the Convert Keys tab, paste your nsec, and confirm it produces the npub you just generated. This simple check catches clipboard errors and ensures your backup is accurate before you start using the identity.

Frequently Asked Questions

What is Nostr?
Nostr (Notes and Other Stuff Transmitted by Relays) is an open protocol for decentralized social networking. Instead of a company owning your account, you own a cryptographic keypair — a private key that proves your identity and a public key that others use to find you. Your posts are signed with your private key and broadcast through relays, which are simple servers that pass messages between users. No single company can ban you, delete your posts, or shut down the network.
What are nsec and npub?
nsec and npub are human-readable encodings of your Nostr private and public keys, defined in NIP-19. An nsec starts with "nsec1" and represents your private key — it is your master password and must never be shared. An npub starts with "npub1" and represents your public key — it is your identity that you share with others. Both use bech32 encoding with built-in error detection, making them safer to copy and paste than raw hex strings.
What is the difference between bech32 (nsec/npub) and hex format?
Hex format is the raw 64-character hexadecimal representation used internally by the Nostr protocol. Bech32 (nsec/npub) is a display format designed for humans — it includes a prefix that identifies the key type and a checksum that catches typos. Use bech32 when sharing or entering keys. Use hex when working with protocol-level tools or debugging. Our tool converts between both formats instantly.
Is it safe to generate keys in a browser?
Yes, when done correctly. Our generator uses the audited @noble/secp256k1 cryptographic library and your browser's built-in crypto.getRandomValues() for randomness — the same primitives used by Bitcoin wallets. No key material ever leaves your device. For maximum security, you can disconnect from the internet before generating keys, and the tool will still work.
What happens if I lose my private key (nsec)?
Your Nostr identity is permanently lost. There is no "forgot password" flow, no customer support, and no recovery mechanism. Your private key is the only proof of your identity. Back it up immediately — write it down and store it in a safe place, save it in a password manager, or both. Treat it like the master key to your entire online identity, because that is exactly what it is.
Why is there no QR code for my private key?
Generating a QR code for your private key (nsec) would make it dangerously easy to accidentally share. Someone could photograph your screen, a camera could capture it in the background, or you might share the wrong QR code. We generate QR codes only for your public key (npub), which is safe to share at meetups, on business cards, or anywhere people need to find you on Nostr.
Should I paste my nsec into websites?
Avoid it whenever possible. For day-to-day Nostr use, signing extensions like Alby or nos2x hold your private key securely and sign events without exposing it to websites. Use this generator for initial key creation and backup — then use a signer for everything else. If you must paste your nsec into a client app, verify the app is reputable, open-source, and running locally.
What are Nostr relays and how do I connect?
Relays are simple servers that store and forward your Nostr messages. When you post, your signed message is sent to one or more relays. When someone reads your posts, they fetch them from those relays. Connect to 5-10 relays for redundancy — if one goes down, your posts are still available on others. Visit nostr.watch for a live directory of relays with uptime and performance metrics.

Related Tools