Created
April 2, 2026 17:00
-
-
Save bleonard/3b553b647f544ad38236bfbcea90da96 to your computer and use it in GitHub Desktop.
Rijksmuseum Wikipedia HTML token count: 96,381 tokens (gpt-5 / o200k_base)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { encoding_for_model, TiktokenModel } from "tiktoken"; | |
| const URL = "https://en.wikipedia.org/wiki/Rijksmuseum"; | |
| const MODEL = "gpt-5" as TiktokenModel; | |
| const response = await fetch(URL); | |
| const html = await response.text(); | |
| const encoding = encoding_for_model(MODEL); | |
| const tokens = encoding.encode(html); | |
| console.log(`HTML length: ${html.length.toLocaleString()} characters`); | |
| console.log(`Token count (${MODEL}): ${tokens.length.toLocaleString()}`); | |
| encoding.free(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment