Clean Copy-Pasted PDF Text Without Changing Original Wording

Get clean, readable text from messy PDF copy-pastes with broken lines, split hyphens, and stray headers removed while keeping the original wording.

Text prompt for ChatGPT and Claude

You get: Cleaned Text, removed Artifacts and flagged Issues

Prompt

Prompt
You are a meticulous copy editor who prepares extracted document text for clean reading and reuse.

The user will paste raw text copied from a PDF right after this prompt. Clean the formatting artifacts without rewriting, summarizing, or altering the author's wording.

Rules:
1. Rejoin words that were split across line breaks with a hyphen, removing the hyphen only when the word is not normally hyphenated.
2. Merge mid-sentence line breaks into continuous paragraphs, while preserving intentional paragraph breaks, bullet lists, and section headings.
3. Remove stray page numbers, running headers, and repeated footers that interrupt the body text.
4. Fix obvious spacing artifacts such as double spaces or spaces before punctuation, but keep all original spelling, numbers, and punctuation intact.
5. If a sentence or table looks cut off or garbled beyond safe repair, leave it as is and flag it at the end.

Output format:
- Cleaned Text: the full, ready-to-use text with original paragraph structure preserved.
- Removed Artifacts: a brief bulleted list of any headers, footers, or page numbers stripped out.
- Flagged Issues: any garbled lines or uncertain hyphenations left for the user to verify, or "None."

Note any assumptions made about paragraph breaks or ambiguous hyphenations.

Example output

Example for: two paragraphs copied from a 2025 municipal transit report PDF.

Cleaned Text

Ridership across the Metro North corridor increased by 14.2 percent during the third quarter, driven primarily by expanded express bus service between Oakridge Station and the downtown business district. Average weekday boardings reached 42,850 passengers, surpassing the pre-pandemic baseline recorded in late 2019.

To sustain this growth, the transit authority recommends adding four articulated buses to Route 18 and upgrading real-time arrival displays at twelve high-volume stops. Capital funding for these improvements will be drawn from the regional mobility grant approved in April, with procurement scheduled to begin in early 2026.

Removed Artifacts
  • Running header: "2025 Regional Transit Performance Review"
  • Page number: "Page 14"
  • Repeated footer: "Draft for Public Comment — Do Not Cite"
Flagged Issues
  • None. All hyphenated line breaks ("pre-pandemic", "high-volume", "real-time") were retained as standard compound modifiers, while "primarily" and "improvements" were rejoined without hyphens.

Assumptions: The gap after "late 2019." was treated as an intentional paragraph break based on the shift from ridership metrics to capital recommendations.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Forbids rewriting or summarizing so the original author's wording and numbers stay exact.
  • Distinguishes between split line-break hyphens and true compound words like 'real-time'.
  • Separates removed headers and garbled lines into a clear audit trail at the bottom.

Use this in ChatGPT, Claude, or Gemini whenever you copy text from a PDF and get jagged line breaks or stray page numbers. Paste the prompt, then paste your raw PDF text right below it.

Common edits

  • Add a rule to convert all-caps section headings into Title Case.
  • Ask the model to format extracted tables into Markdown tables instead of plain text.

Reuse it: Use in a workflowTurn into a skillAdapt in the builder

More in Data Analysis
Data Analysis

Compare Two Document Versions by Added, Removed, and Reworded Text

Get a structured diff report separating added, removed, and reworded text with exact paragraph or line locations.

Data Analysis

Convert a Markdown Table to CSV or JSON with Row and Column Validation

You get a clean CSV or JSON conversion of your Markdown table, plus a row-and-column count check that flags any ragged rows.

Data Analysis

Redact Personal Information with Consistent Tokens and an Audit Log

Get your pasted text back with personal details replaced by consistent typed tokens, plus a separate audit table showing every masked item.

Data Analysis

Turn Voice-Memo Transcripts into Decisions, Actions, and Questions

You get clean, structured notes from a rambling voice-memo transcript, sorted strictly into verified decisions, action items with owners, and open questions.

Data AnalysisClaude

Turn Chart Data Into a Captioned Video With WebM Export

Get one offline HTML file that turns pasted chart data into a 20-second captioned video you can scrub, step through live and export as WebM in 16:9 or 9:16.

Data Analysis

Clean inconsistent date formats and text categories

Turn chaotic timestamp formats and varied categorical spellings into unified standards. Use it when mismatched export values break dashboards.