The 'context length exceeded' error means you've hit ChatGPT's maximum amount of text it can consider at once. Different models have different limits — from 16K tokens to over 1M. Here's how to diagnose and work around the issue.
'The message you submitted was too long' error
'Context length exceeded' or 'maximum context length' message
Long conversations suddenly stop working
Uploaded documents fail to process
ChatGPT starts 'forgetting' earlier parts of the conversation
API returns 400 error with context length message
You pasted a massive amount of text in a single message (e.g., a 200-page document). Each model has a per-message and total conversation limit. GPT-4o has 128K token context (~300 pages); anything larger fails.
Chat history adds up. After many back-and-forth turns, the total conversation (your messages + ChatGPT responses + any documents) exceeds the model's context window. ChatGPT may silently drop early messages or error out.
PDF or DOCX uploads that exceed the model's context cause errors. Even if a PDF is 20MB, what matters is the text length after extraction. A text-heavy 50-page PDF may exceed limits; an image-heavy 200-page PDF may not.
GPT-3.5 has a 16K context window (smaller than most modern alternatives). Claude has 200K-1M depending on tier. Gemini has up to 2M. Using GPT-3.5 for long-context tasks is a common mistake.
Technical content like code and structured data takes more tokens per character than prose. Paste 50 pages of code and you may hit limits faster than 50 pages of prose.
When to try: First option for accumulated long conversations
The fastest fix: start a new chat. You lose the conversation history, but you immediately have full context available again. Copy any important context (summaries, decisions, specific prompts) into the new chat.
When to try: For long collaborative sessions
Ask ChatGPT to summarize the conversation so far in 500 words, capturing: what we're working on, key decisions, where we are. Copy that summary to a new chat as context. This preserves continuity while freeing up context space.
When to try: For document processing tasks
For document analysis, split into logical sections (chapters, articles, themes) and analyze each separately. Then synthesize findings in a final summary step. This often produces better analysis than trying to process everything at once.
When to try: When you need to process large documents regularly
Use Claude (claude.ai) for tasks needing 200K+ context, or Gemini for 1-2M tokens. NotebookLM is purpose-built for analyzing large documents with citations. For serious long-context work, these tools outperform ChatGPT.
When to try: For large reference materials with many queries
Instead of pasting 100 pages into chat, use a RAG tool (NotebookLM, Custom GPTs with file uploads, or Claude Projects) that retrieves relevant sections on demand. Much better for large reference materials you'll ask many questions about.
When to try: For developers building with API
If hitting API context errors, options: (1) Use gpt-4o or gpt-4-turbo which have 128K context, (2) Use Claude API with 200K context, (3) Implement chunking with summaries, (4) For massive contexts, use Gemini 1.5 Pro with up to 2M tokens.
For document analysis, plan your strategy before uploading — don't paste everything at once
Keep conversations focused on one topic — start new chats for new topics
Know your model's context window — GPT-3.5: 16K, GPT-4o: 128K, Claude: 200K-1M, Gemini: up to 2M
For recurring document questions, use RAG tools instead of chat interfaces
Ask ChatGPT 'summarize what we've covered' periodically — helps preserve context while staying under limits
Context length errors are usage-related, not account issues. Support generally can't help beyond pointing you at the same solutions above. If you're hitting context limits on ChatGPT Team/Enterprise, ask about custom limits or higher-context model access. For API users, upgrading to higher usage tiers unlocks access to longer-context models.
The context window is the maximum amount of text ChatGPT can consider in a single conversation — your messages, its responses, and any uploaded documents combined. Measured in tokens (roughly 4 characters per token). Models: GPT-3.5 (16K tokens), GPT-4o (128K tokens), Claude (200K-1M), Gemini (up to 2M). When you exceed it, older content gets dropped or you get errors.
For GPT-4o (128K context): roughly 300 pages of prose, 150 pages of code or dense text. PDFs work but text extraction affects what fits. Claude at 200K handles ~500 pages. Gemini at 2M handles entire textbooks. Always check your model's limit before uploading large documents.
When a conversation approaches the context limit, ChatGPT silently drops older messages to stay under the limit. You don't get an error, but it starts 'forgetting' details from early in the chat. Solution: summarize the context periodically and paste the summary, or use a longer-context model for important long conversations.
For 2026: Gemini 1.5/2 Pro supports up to 2M tokens — the longest context generally available. Claude 3/4 supports 200K-1M tokens with excellent retrieval quality. For document-focused work, NotebookLM (built on Gemini) is purpose-built for long-document analysis with citations. Choose based on your specific task and document type.