Loading ToolDeck, please wait.

ToolDeck.online

INITIALIZING_

0%
DESIGNED BY SJ VISUAL FLOW STUDIOS
ToolDeck.onlineOpen. Build. Go.

System Prompt Token Counter

Count tokens in your instructions before you send them. No upload, no sign-up.

292 chars
Total tokensExact
—tokens

Loading tokenizer…

Characters
292
Words
50
Lines
6
Chars / token
—

Paste your system prompt, instructions, or persona into the box. It is counted exactly with OpenAI's tokenizers. Your prompt is never uploaded. No sign-up, no credits, no limits.

  • Pre-filled example
  • Exact API match
  • Cost estimation
  • No upload
  • Runs offline

How many tokens is my system prompt?

Paste your prompt into the box above. It is counted exactly with OpenAI's tokenizers (o200k_base for GPT-4o, cl100k_base for GPT-4). The count updates as you type and nothing is uploaded. Use this to estimate costs or check if your prompt fits inside the context window.

Price
Free, no credits, no sign-up
Tokenizer
Exact match for OpenAI (o200k_base & cl100k_base)
Models covered
GPT-4o, GPT-4.1, GPT-4, GPT-3.5 Turbo
Why count it?
System prompts are sent on every API request
Text uploaded to server
No, runs 100% in your browser
Input
System instructions, JSON schemas, personas
Extras
Characters, words, lines, chars-per-token ratio
Best browsers
Any modern browser (Chrome, Edge, Firefox, Safari)
Works offline
Yes, after the first load
Not included
Cost-per-1K calculator, batch file upload, saved history

What is a system prompt token counter?

This is a free, browser-based tool that counts the tokens in your system prompts before you send them to an AI model. A system prompt is the set of instructions (persona, rules, formatting requirements) you give the model at the start of a conversation. Because it is sent on every single request in a multi-turn chat, it directly affects both your API costs and your available context window. This tool uses the exact OpenAI tokenizers so you can accurately budget your prompt.

It is best for AI engineers, prompt engineers, and anyone building with the OpenAI API. It is not built for counting image tokens (Vision) or calculating exact dollar amounts, because model prices change often.

How to count system prompt tokens in 3 steps

  1. 1

    Paste your system prompt

    Paste your instructions, rules, or persona into the box. We have pre-filled a sample to show you how it works.

  2. 2

    Check the count

    Read the exact token count, plus characters, words, and chars-per-token ratio. Pick GPT-4o or GPT-4 to match your model.

  3. 3

    Optimize and save

    Trim redundant instructions to reduce the token count. Remember, this prompt is sent on every turn of a conversation, so small savings add up fast.

Features

  • Pre-filled with a real prompt

    We start you off with a realistic system prompt so you can see exactly how the tool works without typing anything. Just hit "Clear" to start pasting your own.

  • Stop overpaying on every request

    System prompts are sent on every single turn of a conversation. If your system prompt is 1,000 tokens and you have a 10-turn chat, you are paying for 10,000 tokens. Trim it down and save money.

  • Exact API Matches

    We use the official o200k_base (GPT-4o) and cl100k_base (GPT-4) tokenizers. The numbers you see here match the `usage.prompt_tokens` you get from the OpenAI API exactly.

  • Context Window Budgeting

    Your system prompt eats into your 128k context window. Check its size here so you know exactly how much room you have left for user messages, RAG chunks, and the model's output.

  • Code & JSON Support

    Building an AI coding assistant? System prompts often contain massive JSON schemas or code examples. Paste them here to see their true token weight.

  • 100% Private

    The tokenizer runs locally in your browser using JavaScript. Your proprietary system instructions and API keys are never sent to our servers or stored anywhere.

What you can use the system prompt counter for

  • AI Agent Instructions

    If you are building an autonomous agent, the system prompt often contains rules, tool definitions, and formatting instructions. Check the token count to ensure it fits comfortably in the context window.

  • Chatbot Personas

    Writing a complex persona for a customer support bot? Verify the prompt size to estimate your per-message costs before you deploy it to thousands of users.

  • RAG Applications

    In RAG, you combine a system prompt, retrieved documents, and the user query. Measure the system prompt here so you can accurately calculate how many tokens you have left for retrieved chunks.

  • Prompt Compression

    Try rewriting your system prompt to be more concise. Compare the token count before and after to see the exact savings. Every token counts when you scale.

  • Structured Output (JSON)

    Forcing an LLM to output specific JSON often requires a large system prompt with a schema. Paste that schema here to see how much it costs per request.

  • Avoiding API Errors

    If your system prompt is too large, the API will reject your request. Count it here first to ensure you are well under the limit.

System Prompt Token Counter FAQ

Answers about accuracy, context windows, pricing, and how system prompts affect your API bill.

Usage & Accuracy

Does the system prompt count toward my context window?

Yes. Every request sends the system prompt again, and it counts toward the context window and the bill. If you have a 128k token context window and a 2k token system prompt, you only have 126k tokens left for the user input and the model's response.

Does this match the OpenAI API exactly?

Yes. We use the official tokenizer libraries (o200k_base for GPT-4o, cl100k_base for GPT-4). The number you see here will match the `usage.prompt_tokens` returned by the API.

Can I count a full conversation?

Yes. Paste the entire conversation (system, user and assistant turns) into the box. The tool counts every character you paste, so it will match what the API would receive.

Is my prompt saved or logged?

No. The tokenizer runs entirely in your browser. Your text is never sent to our servers, and it disappears when you close or refresh the page.

Context Windows & Cost

Why does the system prompt matter for cost?

In a multi-turn conversation, the API is stateless. You must send the system prompt again on every single request. If your system prompt is 1,000 tokens and you have a 10-turn chat, you are paying for 10,000 tokens just for the instructions.

What happens if my system prompt is too long?

If the system prompt plus the user input exceeds the model's context window (e.g., 128k for GPT-4o), the API will reject the request. Use this tool to ensure it fits.

How do I calculate the cost?

Find the current price per 1,000 tokens for your specific model. Multiply your token count by that price. ToolDeck does not display dollar amounts because prices change frequently.

Practical Usage

Can I count code?

Yes. System prompts often contain code snippets or JSON schemas. Code usually uses more tokens per character than English because of punctuation, brackets and symbols.

Can I count non-English text?

Yes, but the count will be higher than the same text in English. For GPT-4o and GPT-4 the OpenAI tokenizers are accurate for all languages.

How many words is 1,000 tokens?

About 750 words of plain English. For code or non-English text, the word count will be lower.

What this tool does well, and where it is limited

This page is perfect for counting instructions, but it only counts plain text. Check this table to see if it fits your use case.

System prompt token counter use cases and results
Use caseResultNotes
Counting system prompt tokensExactUses the official tokenizers, matching the API exactly.
Counting the full conversationWorksPaste the system prompt and the user messages together to get the total context size.
Counting Claude system promptsApproximateSwitch to Claude for an estimate, or use the dedicated Claude Token Counter.
Calculating exact dollar costNot calculated hereMultiply the count by the current OpenAI pricing yourself.
Counting images in prompts (Vision)Not supportedImage tokens are calculated based on resolution and detail level, not plain text.

Tips

  • Keep instructions concise

    LLMs do not need overly verbose instructions. Short, direct bullet points often work better than long, flowery paragraphs, and they use far fewer tokens.

    Open the main Token Counter

  • Remove redundant examples

    If you are using few-shot prompting, check if the model still performs well with just 1 or 2 examples instead of 4 or 5. It will drastically cut your token count.

  • System prompts run every time

    A 1,000-token system prompt sent in a 10-turn conversation costs 10,000 tokens. Keep it as short as possible to optimize costs.

  • Count before you build

    If you are building a tool that runs 100,000 times a day, a 500-token system prompt costs 50 million tokens daily. Count it first and optimize early.

ToolDeck vs other token counters

Many generic token counters give you an empty text box and no context for how system prompts are billed. ToolDeck starts with a real example and optimizes for API costs.

Comparison of ToolDeck system prompt counter and other tools
FeatureToolDeckGeneric counters
Specifically tailored for system promptsYes, pre-filledNo, blank text boxes
Uses exact OpenAI tokenizersYes, matches APIOften guesses or uses older versions
Your text is uploaded to a serverNeverUsually yes
Sign-up neededNot requiredOften
Free credits or paywallsNoneOften
Real-time counting as you typeYesUsually yes
Character, word and line countsYesSometimes
Works offline after loadingYesUsually no

General comparison. Individual tools differ, and features, limits and pricing change.

Responsible use

The counter is a reference tool. Always confirm the exact count with the provider's API before you depend on it in production. Prices and tokenizers change; this page is updated when they do.

More free AI and developer tools

Model-specific counters and other browser tools. Nothing uploaded, ever.

See all ToolDeck tools

Your prompts never leave your device

There is no upload step and no account. The tokenizer runs in your browser, so every count happens on your own device. You can check this yourself: open your browser developer tools, go to the Network tab, then paste text and watch for file uploads. You will not see any. Read how we keep it private.