Created
April 2, 2026 17:00
-
-
Save bleonard/5cb494cac7f9013eda86a7fce66550fa to your computer and use it in GitHub Desktop.
Antoni Gaudí Wikipedia HTML token count: 162,517 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/Antoni_Gaud%C3%AD"; | |
| 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