DeepSeek “Parsing Failed” Error: What It Means and How to Fix It (2026)

DeepSeek Parsing Failed
On this page
  1. Which "parsing failed" do you have?
  2. Fix "parsing failed" on uploaded files (DeepSeek chat)
  3. Fix "parsing failed" in apps that use DeepSeek
  4. Fix JSON parsing errors in your own code (API)
  5. DeepSeek API error codes
  6. FAQ

"Parsing failed" in DeepSeek means something could not be read in the expected format. In the DeepSeek chat app it usually appears on an uploaded file that DeepSeek could not extract text from (a scanned PDF, a protected or damaged file, an unsupported format or a very large file). In apps and code that use the DeepSeek API (chatbots, JanitorAI, Clay, Cursor, scripts) it means the reply could not be parsed, usually because the JSON was cut off, came back empty, or contained thinking text. The fix is to give DeepSeek a cleaner file, or to fix the request settings.

Which "parsing failed" do you have?

Where you see itWhat failedMost likely causeQuick fix
DeepSeek chat (web or app), on an attached fileReading the fileScanned/image-only PDF, password-protected or damaged file, unusual format, file too bigRe-export the file as a normal PDF/DOCX/TXT, run OCR, or upload fewer pages
A third-party app or website that uses DeepSeekReading DeepSeek's replyReply cut off, empty, or not valid JSON; old model name; server busyRetry, raise the max tokens / response length, choose a current model, update the app
Your own code (API)JSON.parse / json.loads on the replyJSON mode not set correctly, max_tokens too low, <think> text in content, error page instead of JSONFollow the JSON Output rules below and validate before parsing
Local model (Ollama, LM Studio) used in an appParsing the model's outputR1-style models print a <think>...</think> block before the answerStrip the think block, or use a non-thinking model for structured output

Fix "parsing failed" on uploaded files (DeepSeek chat)

  1. Check that the PDF has real text. Open it and try to select and copy a sentence. If you can't, it's a scan or photo with no text layer. Run OCR first (for example "Make searchable" / OCR in a PDF editor, or Google Drive: open with Google Docs), or upload the pages as images instead.
  2. Remove passwords and restrictions. Password-protected or "secured" PDFs and Office files often can't be parsed. Save an unprotected copy (only for files you are allowed to share).
  3. Re-save the file cleanly. Open it in the original app and use Save As / Export to PDF, DOCX or TXT. Renaming the extension (for example .pages to .pdf) does not convert the file.
  4. Make it smaller. Split long documents and upload only the pages you need. Very large files and long spreadsheets are the most common failures.
  5. Use a simple format. For tables, try CSV or XLSX; for code, paste it as text; for complex layouts (forms, heavy annotations), flatten or print to a new PDF first.
  6. Start a new chat and retry. Long conversations with many files can fail; a fresh chat with one file is the cleanest test.
  7. Check if DeepSeek is having problems. If even a tiny .txt file fails, the service may be overloaded; see DeepSeek "server is busy" and try again later.
  8. Paste the text as a last resort. If the file keeps failing, copy the text you need straight into the message box.

Privacy tip: don't upload confidential documents to any AI chatbot unless your work allows it; uploaded files become part of your conversation data.

Fix "parsing failed" in apps that use DeepSeek

If the error appears inside another app (a roleplay site, spreadsheet add-on, coding tool or chatbot builder), the app asked DeepSeek for an answer and could not read what came back.

  1. Retry once or twice. Temporary overload (HTTP 503) or timeouts often return an error page instead of a normal answer.
  2. Increase the response length / max tokens in the app's settings, so long JSON answers aren't cut off halfway.
  3. Pick a current model. DeepSeek renamed its API models in 2026. Its change log said the old names deepseek-chat and deepseek-reasoner would be discontinued on 24 July 2026; current names in the API docs (November 2026) are deepseek-flash and deepseek-v4-pro. Old presets may break.
  4. Turn off "thinking"/reasoning mode for structured tasks if the app can't handle reasoning output.
  5. Check your API key and balance. A 401 (wrong key) or 402 (no balance) reply is not the answer the app expects; see also DeepSeek rate limit errors.
  6. Update the app or plugin, or switch its provider setting to DeepSeek's official endpoint (https://api.deepseek.com) if a proxy is in between. Specific setup for JanitorAI is in how to use DeepSeek on JanitorAI.

Fix JSON parsing errors in your own code (API)

DeepSeek's official JSON Output guide lists what you need for reliable JSON:

  1. Set response_format to {"type": "json_object"}.
  2. Include the word "json" in the system or user prompt, and give an example of the exact JSON shape you want.
  3. Set max_tokens high enough that the JSON isn't cut off.
  4. Handle empty replies: DeepSeek notes the API may return content with only spaces when the output isn't recognised as JSON. Check for blank content and retry instead of parsing it.

Also:

  • Check the HTTP status before parsing. Errors such as 400, 401, 402, 422, 429, 500, 503 and 504 come with an error message, not your JSON. Retry 429/500/503 with backoff; fix the request for 400/422.
  • "Unexpected token <" means you received HTML (an error or proxy page), not JSON.
  • Strip code fences and think blocks. Without JSON mode, models often wrap JSON in ```json fences or (in reasoning models) put a <think> section first. Remove these before parsing, and read only the final answer field, not the reasoning content.
  • Validate the result with a schema (for example Pydantic or Zod) and retry with the validation error in the prompt if it fails.
  • Use streaming carefully: only parse after the stream has finished.

DeepSeek API error codes

CodeMeaningWhat to do
400Invalid formatFix the request body
401Authentication failedCheck the API key
402Insufficient balanceTop up the account
408 / 413 / 504Upload too slow, file too large, or processing timed outUse a smaller file, retry later
422Invalid parametersFix the parameters (model name, fields)
429Rate limit reachedSlow down; retry with backoff
500 / 503Server error / overloadedWait and retry

Source: DeepSeek API documentation (error codes and JSON Output guide).

FAQ

Why does DeepSeek say parsing failed for my PDF?

Most often the PDF is a scan with no selectable text, is password-protected, or is very large. Run OCR, remove the password, or upload fewer pages.

Is "parsing failed" a problem with my account?

No. It's a problem with the file or the reply format, not a ban or account issue.

Can DeepSeek read images?

The chat app can read text from many images, but results vary; for documents, a text-based PDF or DOCX parses more reliably.

Does running DeepSeek locally avoid the error?

Not for files; local tools need their own document loaders. Local R1-style models also add think blocks that break parsers. See DeepSeek R1 hardware requirements if you want to run it locally.

Related guides