๐ข AI Token Efficiency: JSON vs XML vs YAML vs Markdown - Which Format Saves You More Money?
๐Load Example Data
๐JSON Format
๐ท๏ธXML Format
๐YAML Format
๐Markdown Format
โณ Initializing js-tiktoken library...
Format
Formatted Tokens
Minified Tokens
Formatted Chars
Minified Chars
๐ JSON
-
-
-
-
๐ท๏ธ XML
-
-
-
-
๐ YAML
-
-
-
-
๐ Markdown
-
-
-
-
๐ Token Breakdown by Format
๐JSON Tokens
Formatted (0 tokens)
Minified (0 tokens)
๐ท๏ธXML Tokens
Formatted (0 tokens)
Minified (0 tokens)
๐YAML Tokens
Formatted (0 tokens)
Minified (0 tokens)
๐Markdown Tokens
Formatted (0 tokens)
Minified (0 tokens)
Format
Formatted Tokens
Minified Tokens
Formatted Chars
Minified Chars
๐ JSON
-
-
-
-
๐ท๏ธ XML
-
-
-
-
๐ YAML
-
-
-
-
๐ Markdown
-
-
-
-
๐API Keys
๐คModel Selection
โ ๏ธ Note about Model Selection:
In testing, Google Gemini and Anthropic Claude APIs return the same token counts regardless of which model is selected.
The token counting appears to use a shared tokenizer across models within each provider.
Model selection may still be useful for future API updates.