CraftTools

Find and Replace

Guide: How to Clean Up Text Copied From PDFs and Websites

No matches.

Nothing you enter or choose here leaves your device. This tool runs in your browser.

How to use

  1. 1Paste your text into the box.
  2. 2Type what to find and what to replace it with.
  3. 3Choose options such as match case, whole word or regular expression.
  4. 4Read the result and click Copy, or use it as the next input.

Frequently asked questions

Does it replace every match?

Yes. All matches are replaced at once, and the tool tells you how many were changed.

How do I use regular expressions?

Tick "Regular expression" and write a pattern, such as \d+ for numbers. In the replacement, $1 is the first group, $& is the whole match and $<name> is a named group.

What does "Whole word" do?

It only matches complete words, so finding "cat" leaves "category" alone.

Why did it say the pattern took too long?

Some regular expressions can take extremely long on certain text. The tool stops them after two seconds so your browser never freezes. Make the pattern more specific.

Read the guide

Learn how this works and how to get the most from it.

Writing & text

How to Clean Up Text Copied From PDFs and Websites

Fix broken line breaks, double spaces and stray characters in copied text, then sort, number and tidy it in a few clicks.

2 min read

Remove Line Breaks

Join lines into one paragraph. Strip breaks from copied text.

Sort & Dedupe Lines

Sort lines A-Z, reverse them, remove duplicates and trim whitespace.

Regex Tester

Test regular expressions live, with match highlighting and groups.

Case Converter

Switch text to UPPER, Title, camelCase, snake_case and more.