Last updated:

Techniques for Controlling the Character Count of ChatGPT Output

8 min read

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 exampleCharactersEstimated tokensCharacters per token
"人工知能の研究開発"9 characters5 to 7 tokensabout 1.3 to 1.8 characters
"artificial intelligence research"32 characters4 to 6 tokensabout 5.3 to 8.0 characters
"おはようございます" (hiragana)9 characters5 to 9 tokensabout 1.0 to 1.8 characters
"機械学習モデル" (kanji + katakana)7 characters4 to 5 tokensabout 1.4 to 1.8 characters
Python code: print("hello")14 characters5 tokensabout 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.

Practical Examples of Character Count Control

Here are concrete prompt examples and their expected output character counts.

Prompt exampleEstimated output charactersStability of character count
"Summarize in a word"20 to 50 charactersHigh
"Summarize in 3 lines"60 to 120 charactersHigh
"Explain in 100 characters or fewer"60 to 130 charactersMedium
"Write about 500 characters"300 to 700 charactersLow
"In 5 bullet points"150 to 400 charactersHigh (number of items)
"In 140 characters or fewer for a Twitter post"80 to 160 charactersMedium
"3 headings, 100 characters each"250 to 400 charactersMedium

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."

ItemWeb UI (ChatGPT)OpenAI API
Output token limitDepends on the model (set automatically)Can be specified explicitly with max_tokens
"Continue writing"Conversation history kept automaticallyYou need to manage conversation history yourself
StreamingEnabled by defaultEnabled explicitly with stream=true
When output is cut offA control that prompts generating the continuation is providedDetected with finish_reason="length"
Cost managementIncluded in the subscription feePay-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.

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.

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.

Share this article