LLM Token Counter
Count tokens and estimate cost for GPT, Claude, Gemini and Llama prompts, with exact counts where tokenizers are public.
Write better prompts by filling in a proven structure. Add a role, task, context, constraints, output format and examples, reuse {{variables}}, and copy the result 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.
Use {{name}} placeholders, fill them in, and keep the template reusable.
Markdown headings, XML tags or plain labelled text.
Summaries, data extraction, code review, support replies and more.
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.
No. Everything you type is processed in your browser and never leaves your device. Drafts are saved only in this browser's local storage so you can come back to them.
Missing something?
Instant.tools grows from real requests. Describe the task you're stuck on and we'll consider building it next.