Last updated:
Techniques for Controlling the Character Count of ChatGPT Output
Large language models (LLMs) such as ChatGPT are widely used as powerful tools for generating text. However, many users struggle with character count, for example when an instruction to "summarize in 500 characters" does not produce exactly 500 characters, or when the output gets cut off partway through. The root cause is that LLMs process text not in characters but in their own unit called the "token." This article systematically explains practical knowledge for controlling output character count. It covers everything from the inner workings of the tokenizer and the output token limits of each model to control techniques through prompt engineering and the differences between the API and the Web UI.
How the BPE Tokenizer Works and Why It Diverges from Character Count
The GPT models used by ChatGPT split text into tokens with an algorithm called BPE (Byte Pair Encoding). BPE is a method that repeatedly merges frequent byte sequences in the training data to build a vocabulary table. The o200k_base tokenizer adopted by GPT-4o has a vocabulary of about 200,000, a large expansion from the earlier cl100k_base (a vocabulary of about 100,000).
This mechanism is what causes the gap from character count. In English, a common word such as "information" fits into 1 token, while Japanese mixes kanji, hiragana, and katakana, so token consumption differs greatly even for sentences with the same meaning. Understanding this mechanism is also essential for understanding the limits on ChatGPT prompt character counts.
Let us look at a concrete pattern of the gap. "東京都渋谷区" (Shibuya, Tokyo) is 6 characters, but because Japanese is split finely into units of 1 to a few characters even for proper nouns such as place names, it consumes a number of tokens close to its character count. On the other hand, the English "Tokyo Shibuya" fits into a few tokens even though it is 13 characters. As a rough guideline, if you think of Japanese as holding a little over 1 character per token and English as holding several characters' worth of information, you are less likely to misjudge your estimates. This difference is also related to the difference between character count and byte count, and the fact that 1 Japanese character consumes 3 bytes in UTF-8 encoding also affects how efficiently BPE splits text.
| Text example | Characters | Estimated tokens | Characters per token |
|---|---|---|---|
| "人工知能の研究開発" | 9 characters | 5 to 7 tokens | about 1.3 to 1.8 characters |
| "artificial intelligence research" | 32 characters | 4 to 6 tokens | about 5.3 to 8.0 characters |
| "おはようございます" (hiragana) | 9 characters | 5 to 9 tokens | about 1.0 to 1.8 characters |
| "機械学習モデル" (kanji + katakana) | 7 characters | 4 to 5 tokens | about 1.4 to 1.8 characters |
Python code: print("hello") | 14 characters | 5 tokens | about 2.8 characters |
What stands out is that sentences written only in hiragana have lower token efficiency than sentences mixed with kanji. Hiragana takes 3 bytes per character (UTF-8) and is rarely a target for BPE merges, so 1 character comes close to 1 token. With kanji, frequent 2-character compounds are often merged into 1 token, so their efficiency is relatively higher.
However, treat the values in the table above as estimates with a range. Token splitting changes with both the version of the tokenizer used and the surrounding context, and even the same word can have its split points move depending on its position in the sentence. When you need accurate estimates, the only reliable method is to actually count with the tokenizer that corresponds to the model you use.
The Output Token Limit Is Separate from the Context
The first thing people who stumble over character count control get wrong is the relationship between the "context window" and the "maximum output tokens." These 2 are completely separate limits, and their ratio also varies greatly from model to model. Checking the values shown in the public documentation as of August 2026, GPT-4o has an output limit of 16,384 tokens against a context of 128,000 tokens, and o1 has an output limit of 100,000 tokens against a context of 200,000 tokens. The former can use only about one eighth of its input window for output, while the latter can devote half of it to output. In other words, even with the same "large context," the length that can be written at once differs by an order of magnitude.
What to watch out for here is that model names and limit values have a short life. Both series names and limit values change with every generation (as of August 2026, the main series have moved further on from the GPT-4o and o1 generation). For that reason, be sure to check the official documentation at the time of use before hard-coding numbers into an implementation. It is safer to keep the limit as an external setting rather than writing it into code as a constant.
Another pitfall is that the model finishes writing on its own before reaching the limit. The output limit is a cap on "how much can be output," not a guarantee that "that much will be output." Because models are trained to end at a length that is natural for the text, the output does not become long even when the limit is large, and an explicit instruction is needed when you want it to write at length. In addition, models in reasoning series consume tokens internally for their thinking process, so the billable tokens can greatly exceed the character count that appears on the screen. Make it a habit to check the actual consumption in the API's usage field.
Japanese Output Is at a Disadvantage in Both Cost and Length
When conveying the same content, Japanese consumes more tokens than English. The reason is the difference in token splitting efficiency described above. English words tend to come together as 1 token, while Japanese uses 1 token for a little over 1 character, so the token count swells several times over even for the same amount of information.
This difference affects 2 places at the same time. One is API cost: because billing is pay-as-you-go per output token, Japanese costs more. The other is output length: even with max_tokens set to the same value, the number of characters you get in Japanese is considerably smaller than in English. This is what is really behind the phenomenon of "a long enough answer came back in English, but in Japanese it gets cut off partway through."
One countermeasure is to write only the instructions in English and receive the output in Japanese. However, what you save is tokens on the input side, and the cost of outputting the Japanese text does not go down. Keep in mind that this works when the instructions are a lengthy template, but has little effect in uses where a short prompt has the model write a large amount of Japanese. There is also a risk that nuances specific to Japanese drop out of the instructions, so it is reasonable to decide based on cost-effectiveness.
How API Parameters That Affect Output Length Differ in Nature
The parameters related to output length fall into two types by nature. If you confuse them, you get mismatched results such as "I raised the limit but it did not get longer" or "I lowered it and the text broke."
One type is the parameter that sets the upper limit of output, which is max_tokens (max_output_tokens for some models). It works as a hard limit, and generation stops immediately when the specified value is reached, even in the middle of a sentence. It does not stop at a good break point in the text, so if you set it exactly to the target length, you get text with its ending missing. It is more practical to set it to the token count converted from the target character count plus a margin, and wait for the model to finish naturally on its own. In Japanese, 1 token corresponds to a little over 1 character, so when converting, allow for somewhat more tokens than characters.
The other type is the parameter that changes how output is chosen, with temperature as the typical example. Independently of the limit, it adjusts the spread of the probability distribution when choosing the next token. At low values, the model favors high-probability tokens, so variation in output becomes small and reproducibility for the same prompt increases (complete determinism is not guaranteed). At high values, low-probability tokens are also more likely to be chosen, and rephrasing, digressions, and repetition become more likely. For uses where you want a stable character count, the basic approach is to start adjusting from a low value. However, temperature is not a parameter that directly specifies length, so trying to steer toward a target character count with it is a poor way to use it.
Techniques for Controlling Character Count with Prompts
This section introduces prompt design techniques for getting ChatGPT to produce output of a specific character count. LLMs have a limited ability to count characters accurately, so some ingenuity is needed.
- Specify "amount" instead of character count: Rather than "write in 500 characters," instructions such as "write in 3 paragraphs" or "write in 5 bullet points" produce output closer to what you expect. A guideline is about 100 to 200 characters per paragraph and about 30 to 80 characters per bullet point
- Specify a range of character counts: Allowing some range, such as "in the range of 400 to 600 characters" instead of "exactly 500 characters," produces more natural text
- Specify the output format concretely: Specifying the structure, such as "3 headings, with an explanation of 2 to 3 sentences under each heading," makes the character count easier to control
- Use keywords such as "concisely" and "in detail": "Concisely in 1 sentence" tends to produce output of 20 to 50 characters, and "explain in detail" tends to produce output of about 300 to 800 characters
- Set the max_tokens parameter (when using the API): In the OpenAI API, you can set the upper limit of output tokens with the max_tokens parameter. If you are aiming for 500 Japanese characters, set max_tokens to 700 to 1,000
Practical Examples of Character Count Control
Here are concrete prompt examples and their expected output character counts.
| Prompt example | Estimated output characters | Stability of character count |
|---|---|---|
| "Summarize in a word" | 20 to 50 characters | High |
| "Summarize in 3 lines" | 60 to 120 characters | High |
| "Explain in 100 characters or fewer" | 60 to 130 characters | Medium |
| "Write about 500 characters" | 300 to 700 characters | Low |
| "In 5 bullet points" | 150 to 400 characters | High (number of items) |
| "In 140 characters or fewer for a Twitter post" | 80 to 160 characters | Medium |
| "3 headings, 100 characters each" | 250 to 400 characters | Medium |
LLMs are weak at counting characters accurately, so strict specifications such as "exactly 500 characters" are difficult. This is because the model generates in token units and does not calculate, token by token, how many characters each token corresponds to. A realistic approach is to check the character count with Character Counter after output and adjust as needed with instructions such as "make it a little shorter" or "add 100 more characters."
Differences in Output Limits Between the Web UI and the API
The ChatGPT Web UI and the OpenAI API behave differently with respect to output limits. If you do not understand this difference, confusion arises, such as "I could get long text in the Web UI, but it gets cut off partway through in the API."
| Item | Web UI (ChatGPT) | OpenAI API |
|---|---|---|
| Output token limit | Depends on the model (set automatically) | Can be specified explicitly with max_tokens |
| "Continue writing" | Conversation history kept automatically | You need to manage conversation history yourself |
| Streaming | Enabled by default | Enabled explicitly with stream=true |
| When output is cut off | A control that prompts generating the continuation is provided | Detected with finish_reason="length" |
| Cost management | Included in the subscription fee | Pay-as-you-go per token |
To get long text reliably through the API, checking the finish_reason field is essential. When finish_reason is "length," it means the output was cut off at the max_tokens limit. "stop" indicates that the model ended its output naturally. By automating this check and building logic that automatically requests the continuation in the "length" case, you can achieve long output through the API on par with the Web UI.
Prompt Techniques for Getting Long Output Reliably
When generating long text that exceeds the output limit, simply instructing it to "write at length" is not enough. Combining the following techniques gives you stable long output.
- Chain prompts (split generation): Generate the text split by section, such as "first write chapter 1" and "next write chapter 2." By specifying the character count of each section, you can control the overall character count. In the API, you combine the output of each request to build the final long text
- Outline-first method: First generate an outline (the headings and a summary of each section), then expand each section individually. Deciding the overall structure and the allocation of characters in the outline lets you generate well-balanced long text
- Carrying over context: When the output is cut off partway through, include the last 200 to 300 characters of the previous output in the next request and instruct it to "continue the text below." With just "continue writing," the context is lost, and there is a risk that the content will overlap or contradict itself
- Strengthening explicit length instructions: Emphasizing a minimum character count, such as "Please be sure to write at least 3,000 characters. Make each section at least 500 characters," can suppress the model's tendency to end its output early
- Using JSON structured output: If you specify JSON mode with the API's response_format and have each section output as a JSON field, managing character count by section becomes easy.
Common Problems and Pitfalls with ChatGPT Output Character Count
This section introduces problems you are likely to run into with ChatGPT character count control and pitfalls that are easy to overlook.
- The output gets cut off partway through: This happens when the output token limit is reached. In the API, the reliable approach is to detect it with finish_reason="length" and build a mechanism that automatically requests the continuation. The output limit changes by orders of magnitude depending on the model, so build on the assumption that the behavior will change when you switch models
- The output differs greatly from the specified character count: LLMs cannot count characters accurately, so a gap of about ±30% is to be expected. Specifying by structure (number of paragraphs, number of bullet points) gives higher accuracy. In Japanese in particular, the correspondence between tokens and character count is unstable, so the gap tends to be larger than in English
- Japanese output is shorter than English: Even with the same max_tokens setting, the number of characters you get in Japanese falls well below English because of the difference in token efficiency. Do not reuse settings meant for English as they are; work backward from the target Japanese character count and reserve a generous amount
- Repetition occurs: When generating long text, the same content is sometimes repeated. Setting frequency_penalty to 0.5 to 1.0 can suppress this, but raising the value too high hurts the naturalness of the text. Adjusting within the range of 0.3 to 0.7 is practical
- Miscounting tokens: You can calculate the token count of a prompt in advance with the tiktoken library (Python) or gpt-tokenizer (JavaScript), but when the tokenizer changes with a model version upgrade, the token count changes even for the same text. Tokenizers with different vocabulary sizes, such as o200k_base and cl100k_base, split the same text differently, so choose the tokenizer that corresponds to the model you use. If you keep counting with the wrong version, things quietly break first in the places designed right up against the limit
- Consumption of the context window: The longer the input prompt, the fewer tokens are available for output. Even with a model with a 128K context, if you send a 100K-token prompt, only the remaining 28K tokens can be used for output. However, output is also constrained by the max_output_tokens limit, so even if context is left over, output cannot exceed the output limit
Summary
ChatGPT output character count is limited not in characters but in units of tokens split by the BPE tokenizer. Japanese holds only a little over 1 character per token, so it consumes several times more tokens than English even for the same content, putting it at a disadvantage in both cost and output length. To control character count, specifying by structure (paragraph count / number of bullet points) is the most effective, and in the API you can increase output stability with settings close to temperature=0. Understanding the differences in behavior between the Web UI and the API and choosing control methods suited to your use is the key to using ChatGPT efficiently. To check the character count of text generated with ChatGPT, please make use of Character Counter.