{
  "id": 6056722,
  "title": "We Measured the LLM Token Cost of 4 Markup Formats: TSX Costs 94% More Than Pug",
  "url": "https://urgent.news/2026/09/06/we-measured-the-llm-token-cost-of-4-markup-formats-tsx-costs-94-more",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-06T19:00:03.000Z",
  "source": {
    "name": "HackerNoon",
    "slug": "hackernoon",
    "url": "https://hackernoon.com/we-measured-the-llm-token-cost-of-4-markup-formats-tsx-costs-94percent-more-than-pug?source=rss"
  },
  "original_language": "en",
  "account": "The study compares four markup formats (HTML, Pug, JSX, and TSX) for token costs. Pug leads all samples with the cheapest markup, while HTML costs 94% more than Pug on average. JSX and TSX fall at the opposite end, with JSX costing three times Pug for small samples and about 1.9× for larger ones. The cost differences stem from HTML's structural costs like closing tags (48 tokens in the article sample) and JSX/TSX's JavaScript integration. Pug avoids these costs entirely by using indentation instead of closing tags and a simpler attribute syntax. The analysis reveals that while markup costs vary widely, consistency in ranking across samples suggests syntax plays a larger role than example choice.",
  "summary": "We measured four markup formats with one tokenizer. TSX costs 94% more than Pug, and the attribute everyone blames for it turns out to cost nothing.",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}