# Bilibili BV to AV converter (and AV to BV)

> Type a BV ID, an AV number or a video link. The conversion runs in your browser with Bilibili’s own scheme, so nothing is sent anywhere.

Canonical page: https://okdata.online/tools/bv-to-av/

## Example

`BV17x411w7KC` = `av170001`

## How it works

A BV ID is the AV number in disguise. Bilibili sets bit 51 of the number, XORs it with 23442827791579, writes the result in base 58 with its own alphabet (FcwAPNKTMug3GV5Lj7EJnHpWsx4tb8haYeviqBz6rkCy12mUSDQX9RdoZf) after “BV1”, and swaps characters 3 and 9, and 4 and 7. Going back undoes each step and masks the number to 51 bits. The same rule covers the old short IDs and the 15-digit numbers issued since 2024.

## By API

[Bilibili video detail](https://okdata.online/apis/bilibili/videos/get/) `bilibili.videos.get`: $0.002 a call, charged even when the answer is empty or failed; bad parameters are free.

```bash
curl -G "https://api.okdata.online/v1/bilibili/videos/get" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode "id=BV17x411w7KC"
```
