LLM Token Counter
Count tokens and estimate cost for GPT, Claude, Gemini and Llama prompts, with exact counts where tokenizers are public.
Fill in a role, task, context, constraints, output format and examples, and the builder assembles the prompt. Reuse it with {{variables}} and copy it as Markdown, XML tags or plain text.
How it works
Start from a template or a blank prompt.
Fill in the sections that matter for your task; empty sections are left out.
Fill any {{variables}}, choose Markdown, XML or plain text, and copy the prompt.
About this tool
Most disappointing AI answers come from prompts that leave out something important: who the model should act as, what exactly to produce, what it should or shouldn't do, and what the result should look like. Separating those parts makes prompts easier to write, review and improve, and models follow them more reliably.
This builder gives each part its own field and assembles the prompt for you. Examples (few-shot prompting) show the model the pattern you want. Variables like {{customer_message}} turn a prompt into a reusable template you can fill in each time. XML-tag output follows the structure Anthropic recommends for Claude; Markdown headings work well for ChatGPT and Gemini.
Role, task, context, input, constraints, output format and examples. Empty ones are left out.
Use {{name}} placeholders, fill them in, and keep the template reusable.
Markdown headings, XML tags or plain labeled text.
Summarize a document, extract data as JSON, review code, reply to a customer, classify text or outline a blog post.
FAQ
Both work with modern models. XML tags make the boundaries between instructions and data very clear and are recommended in Anthropic's guidance for Claude; Markdown is easier to read and works well everywhere.
One to three good examples usually help a lot, especially for formatting and classification tasks. Make them varied so the model doesn't copy one too closely.
They mark the parts that change each time, like a document or a customer's name. Fill them in the Variables panel to get a ready-to-use prompt, or keep them to reuse the template.
It's an estimate of about 4 characters per token. Use the LLM Token Counter for exact counts for a specific model.
Missing something?
Describe the job and the file types involved. The most requested tools get built first.