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
- Paste the text into your editor.
- Fix line breaks. For text from PDFs, remove line breaks in the middle of paragraphs and keep those between paragraphs.
- Fix quotes and dashes if you need plain ASCII.
- Remove extra spaces.
- Check headings and lists.
- 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.
Notepad+ Text Editor
A fast, advanced text editor for notes and code, with emoji support
More about Notepad+ Text Editor
Drafting Emails in a Text Editor First
Why drafting important emails in a separate text editor prevents accidental sends, improves clarity and helps you write calmer messages.
Read article →Keeping a CV in Plain Text for Easy Updates
Maintain a master CV in a plain-text file so you can update it anywhere, tailor it quickly and paste it cleanly into online application forms.
Read article →Keeping a Work Diary for Performance Reviews
Record your achievements, feedback and challenges throughout the year in a simple text file, so performance reviews and promotions are easier to prepare.
Read article →Outlining a Novel in a Text Editor
Use a plain-text outline to plan characters, chapters and plot for a novel — flexible, searchable and easy to rearrange.
Read article →