---
id: "onion_address"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["internet"]
langs: ["common"]
quality: 80
url: "http://registry.apicrafter.io/datatype/onion_address"
---

# Tor onion service address (.onion) (`onion_address`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Address of a Tor onion service, reachable only through the Tor network. A version 3 address, the only kind that current Tor releases support, is 56 base32 characters followed by .onion. The characters encode the 32-byte ed25519 public key of the service, a 2-byte SHA3-256 checksum and the version byte 3, so the last character is always d. Subdomains may precede it, as in www.<address>.onion. The 16-character version 2 addresses were retired in 2021 and do not match. The regexp checks the form, not the checksum.

- Personal data (PII): no
- Categories: Internet (internet)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:[a-z0-9-]+\.)*[a-z2-7]{54}[aiqy]d\.onion$
```

## Examples

- `pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.onion` — Example of the Tor onion address specification
- `sp3k262uwy4r2k3ycr5awluarykdpag6a7y33jxop4cs2lu5uz5sseqd.onion` — Example of the Tor onion address specification
- `www.xa4r2iadxm55fbnqgwwi5mymqdcofiu3w6rpbtqn7b2dyn7mgwj64jyd.onion` — Address from the Tor specification with a www subdomain added
- `pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscrya.onion` (invalid example) — The last character must be d (version 3)
- `pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.com` (invalid example) — Not under .onion

## Translations

- ru: Адрес onion-сервиса Tor (.onion): Адрес onion-сервиса сети Tor версии 3: 56 символов base32 и суффикс .onion.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/.onion>
- doc: <https://spec.torproject.org/rend-spec/encoding-onion-addresses.html>

## Quality

Score 80/100. Missing: mapping (Wikidata, Schema.org, ...), detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/onion_address.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/internet/onion_address.yaml>
