Smart Apps Pro

Cleaning Up Pasted Text: Smart Quotes, Stray Spaces and Odd Line Breaks

Why text copied from websites, PDFs and messages often looks messy, and how to tidy it in a plain text editor.

Copy text from a web page, PDF or chat, paste it into a note, and it often arrives with odd quirks. Knowing the usual culprits makes cleaning quick.

Why plain text helps

A plain text editor strips most formatting: fonts, colours, sizes and links. That's often what you want when you paste. What remains are the characters themselves, and some of those can still be awkward.

Common problems

Problem What it looks like Fix
Smart (curly) quotes “like this” instead of "like this" replace with straight quotes if you need them for code
Long dashes — where you expected - replace with a hyphen where needed
Extra spaces double spaces between words or lines starting with spaces use find and replace
Hard line breaks each line of a paragraph ends with a break, often from PDFs join lines into paragraphs
Non-breaking spaces look like spaces, but behave differently replace with normal spaces
Odd symbols boxes or question marks often an encoding or font problem
Trailing spaces invisible spaces at the end of lines remove them

Tidying steps

  1. Paste the text into your editor.
  2. Fix line breaks. For text from PDFs, remove line breaks in the middle of paragraphs and keep those between paragraphs.
  3. Fix quotes and dashes if you need plain ASCII.
  4. Remove extra spaces.
  5. Check headings and lists.
  6. Save as UTF-8.

Why smart quotes matter in code

Code and config files need straight quotes. A curly quote looks almost identical, but a program treats it as a different character and may report an error. If you copy code from a web page or chat, check the quotes.

Copying from PDFs

PDFs often produce text with line breaks at the end of every printed line, hyphenated words split across lines, and strange spacing. It takes a few minutes to tidy, but it's worth it if you'll reuse the text.

Links

Pasting into plain text removes link formatting but often leaves the address itself, which is handy.

Best practice

  • Paste as plain text when your keyboard or app offers that option.
  • Clean once, then save the tidy version.
  • Keep the source (a link or a note) so you know where the text came from.

A tidy note is a useful note

Ten minutes of tidying can turn a messy paste into a note you'll be glad to find again.

Get Notepad+ Text Editor →

Notepad+ Text Editor app icon

Notepad+ Text Editor

A fast, advanced text editor for notes and code, with emoji support

Get the app

More about Notepad+ Text Editor