HTML is over 2x costlier than markdown
Was discussing with over on his post and decided to post so it helps others too! (Discussion: https://www.skool.com/cliefnotes/html-over-md-files?p=f349c1fc ), putting the core arguments here
Recently, there was a twitter (X) thread that was talking about how HTML was the better choice over markdown and many claude engineers were making the switch.
BUT, as experimented, HTML is over 2x costlier than markdown.
I made a report with both md and html from the same content
.md: 2k tokens
html: 4.6k tokens (for the exact same information)
More than 2x
Thinking:
.md: 3k - 2k = 1k
html: 5.7k (direct gen from content) - 3.2k = 2.5k
Again more than 2x
Values are attached in the screenshots:
1. Generating md report from content (the one with 3k out tokens, 2k content and 1k thinking)
2. Generating html report from the same content (but this report had very little data so rejected this, still took more tokens) (5.7k out tokens, 3.2k content and 2.5k thinking)
3. Generating html report from md report instucting to put every piece of data (7k out tokens, 4.6k content and 2.4k thinking)
The container tags have both open and close tags while markdown has just a single or a few character prefix for formatting. And then html has attributes, styles, all of which will require more tokens to represent.
You can have more information in the same amount of tokens with markdown.
There can be cases where HTML visualisation can cost lesser than a markdown one (ASCII art for drawing stuff. bar charts in ASCII is still cheaper.) and in those places you can just use html for those specific visualisations. Most markdown readers allow html rendering too for specific sections and you can have the rest of report in md.
I have attached all output files too so you can see them. Markdown report is pretty nice too.
2
1 comment
Ankit Sinha
2
HTML is over 2x costlier than markdown
Clief Notes
skool.com/cliefnotes
Jake Van Clief, giving you the Cliff notes on the new AI age.
Leaderboard (30-day)
Powered by