← All NIPs

NIP-21

nostr: URI scheme

DraftEncoding

Put "nostr:" in front of a NIP-19 code (npub, nprofile, note, nevent, naddr) and you get a link any Nostr app can open, inside notes, on web pages or in QR codes.

At a glance

Status
In use and still allowed to change.
Last changed
Mar 21, 2026

Try it

Edit the form or the JSON: both stay in sync, the badge says whether the result is valid, and tapping any field explains it.

Examples
Valid

Form

Turns a NIP-19 code into a clickable link that any Nostr client or operating system handler understands.

Inputs

A NIP-19 code: npub, nprofile, note, nevent or naddr. nsec is not allowed.

Paste an encoded string here to decode it into the inputs.

The output is "nostr:" followed by the unchanged code. Decoding is the reverse: strip "nostr:" and decode the NIP-19 part.

What's inside

nostr:npub1u4gvd6fgpre4swpt0wxpgdzngn67lx3fj55cxnguym2hk6kwgnxqta308g

URI scheme
nostr:
Prefix (what it is)
npub
Separator
1
Data
u4gvd6fgpre4swpt0wxp…ym2hk6kwgnxq
Checksum
ta308g

How this NIP works

Step 1 of 5

Start from a NIP-19 code

Pick what you want to point at: a profile (npub, nprofile), a note (note, nevent) or an addressable event such as an article (naddr).

In the course

No course chapter covers this NIP yet. The editor above is the quickest way in.

Builds on

See also

Specification

Specification text is quoted in English from the nostr-protocol/nips repository. Our explanations and the interface are translated. Source on GitHub at commit 0046368

Read the spec154 words, quoted from the repository at commit 0046368.

This NIP standardizes the usage of a common URI scheme for maximum interoperability and openness in the network.

The scheme is nostr:.

The identifiers that come after are expected to be the same as those defined in NIP-19 (except nsec).

Examples
  • nostr:npub1sn0wdenkukak0d9dfczzeacvhkrgz92ak56egt7vdgzn8pv2wfqqhrjdv9
  • nostr:nprofile1qqsrhuxx8l9ex335q7he0f09aej04zpazpl0ne2cgukyawd24mayt8gpp4mhxue69uhhytnc9e3k7mgpz4mhxue69uhkg6nzv9ejuumpv34kytnrdaksjlyr9p
  • nostr:nevent1qqstna2yrezu5wghjvswqqculvvwxsrcvu7uc0f78gan4xqhvz49d9spr3mhxue69uhkummnw3ez6un9d3shjtn4de6x2argwghx6egpr4mhxue69uhkummnw3ez6ur4vgh8wetvd3hhyer9wghxuet5nxnepm

Linking HTML pages to Nostr entities

<link> tags with rel="alternate" can be used to associate webpages to Nostr events, in cases where the same content is served via the two mediums (for example, a web server that exposes Markdown articles both as HTML pages and as kind:30023 events served under itself as a relay or through some other relay). For example:

<head>
  <link rel="alternate" href="nostr:naddr1qqyrzwrxvc6ngvfkqyghwumn8ghj7enfv96x5ctx9e3k7mgzyqalp33lewf5vdq847t6te0wvnags0gs0mu72kz8938tn24wlfze6qcyqqq823cph95ag" />
</head>

Likewise, <link> tags with rel="me" or rel="author" can be used to assign authorship of webpages to Nostr profiles. For example:

<head>
  <link rel="me" href="nostr:nprofile1qyxhwumn8ghj7mn0wvhxcmmvqyd8wumn8ghj7un9d3shjtnhv4ehgetjde38gcewvdhk6qpq80cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwswpnfsn" />
</head>