ToolsHub4u

Clean up messy text in one pass

Paste text that arrived from a PDF, a spreadsheet or an email and clear the mess in one pass: line numbers, bullets, stray spaces, curly quotes and punctuation spacing.

  • Eight clean-up steps
  • Find and replace
  • Preset routines
Ready Text & Writing
Order mattersTrimming lines before removing bullets leaves the bullet in place; removing bullets first does not. The steps run in the order listed under the form.
1Enter
2Adjust
3Copy result

Text Toolbox

1

Text and steps

Quick routines

A preset only changes the checkboxes. Review the result before copying.

The original stays in this box until you press Apply or paste again.

Steps to apply
No text yet Live
2

Cleaned text

Characters removed

8

3 steps applied

Cleaned text

  • Trailing spaces stripped

    5 characters removed

  • Repeated spaces collapsed

    1 characters removed

  • Blank lines removed

    2 characters removed

Steps applied
3
Lines before
6
Lines after
4
Words after
21

Steps run from the top of the list down, then find and replace runs last. Nothing is written back to the input until you press Apply.

Paste text that has arrived from a PDF, a spreadsheet, an email thread or a word processor, tick the fixes you need, and the box returns something you can use. Nine clean-up steps, plus find and replace, applied in one pass.

The page opens with four steps already ticked: trim the start of each line, strip trailing spaces, collapse repeated spaces, and remove blank lines. On the loaded sample that turns six lines into four and reports 8 characters removed.

The nine steps

What each clean-up step matches and what it produces
StepWhat it removes
Line numbersA number of up to three digits, then a full stop or bracket, then a space, at the start of a line
BulletsA leading dash, bullet, middot, square, circle, asterisk or plus, then a space
Trim linesSpaces and tabs at the start of every line
Strip trailing spacesSpaces and tabs at the end of every line
Collapse spacesAny run of two or more spaces or tabs, replaced with one space
Straighten quotesCurly single and double quotes, replaced with straight ones
Normalise dashesEn, em and horizontal-bar dashes become a hyphen; ellipsis becomes three dots
Fix punctuation spacingA space before , . ! ? ; :, and a missing space after them
Remove blank linesEvery line that is empty or only whitespace

Line numbers and bullets are the two that save the most time on a paste from a PDF. 1. First item, 2) Second item and 3. Third all lose their prefixes, and a run of •, -, * and · lines all lose their markers.

Bullets is the one to check before you trust it. A line that begins with a hyphen is stripped whether it is a list item or a dash of dialogue, and a negative number at the start of a line loses its sign.

The order is fixed

Steps run from the top of the list down — the order in the table above — and find and replace runs last. Ticking them in a different order changes nothing, which matters for two pairs in particular.

Collapse spaces runs before fix punctuation spacing, so Hello , world first becomes Hello , world and then Hello, world. Run them the other way round and the space before the comma would survive.

Remove blank lines runs near the end, so it cleans up the gaps left by the earlier steps as well as the ones that were there already. Only steps that actually change something are listed in the report, which is why the default run on the sample says three steps applied rather than four — trimming the start of lines found nothing to do.

What fix punctuation gets wrong

This step is the one to use with care. To add a missing space after a full stop it looks for a full stop followed by a letter or digit, and inserts a space between them. A decimal point is a full stop followed by a digit, so numbers get broken:

Worked exampleInput: 3.14 and 2.5
Output: 3. 14 and 2. 5
Input: Version 1.2.3 ships
Output: Version 1. 2. 3 ships

Leave that step off any text containing decimals, version numbers, IP addresses or times. The other three punctuation cases it handles are a space before a comma or full stop, which it removes, and a missing space after a comma, which it adds.

It does not touch quotations. Hello , world ” becomes Hello, world ” — the space before the closing quote stays, because the rule only looks at the six punctuation marks and not at quotes or brackets. Two further gaps: it does nothing to an ellipsis, and repeated punctuation such as !!! is left alone.

Quotes and dashes

Straighten quotes covers the curly single and double forms, including the low and reversed variants that come out of Word and some PDFs, plus prime marks. Everything becomes a plain ' or ". That is what you want for code, CSV fields and plain-text email; it is not what you want for a page that should keep typographic quotes.

Normalise dashes turns en dashes, em dashes and horizontal bars into a hyphen, and a single ellipsis character into three dots. It does not add spaces around the dash, so word—word becomes word-word. If your style needs spaced dashes, do that with a find and replace afterwards.

Find and replace

The two fields at the bottom work as a literal search, not a pattern. Every occurrence of the exact string is replaced, and the report tells you how many matches there were. There are no wildcards, no case-insensitive option and no way to replace only the first match or only whole words. Searching for cat also changes the middle of category.

It runs after all the ticked steps, so it sees the cleaned text. That is usually what you want — replacing a curly quote after the quotes have been straightened would find nothing — but it does mean a replacement can be altered by an earlier step if you tick one that touches it.

Empty results and applying

If none of the selected steps match anything, the status says "Nothing matched" and the output is the input, unchanged. That is not an error: it usually means the text was already clean, or the step you expected is not the one that handles your problem.

Two things the tool does not touch: a non-breaking space between words survives collapse spaces, because that step only matches ordinary spaces and tabs; and tabs inside a line become a single space rather than a tab stop.

Nothing is written back to the input until you press Apply, so you can compare the two before committing. After that the original is gone — copy it first if you may need it. Everything runs in the tab and nothing is uploaded.

Questions

Common questions

Short answers to what people ask before using this tool.

What does the text toolbox clean up?

Nine things: line numbers, bullet markers, leading indentation, trailing spaces, repeated spaces, curly quotes, dashes, punctuation spacing and blank lines. Find and replace runs last.

Does the order I tick the boxes matter?

No. Steps always run in the fixed order shown in the list, whatever order you tick them. Find and replace always runs after every step.

Why did my decimals get a space in them?

The punctuation spacing step adds a space after a full stop when a letter or digit follows. In "3.14" the digit is the problem, so it becomes "3. 14". Leave that step off for decimals, versions and IP addresses.

Why are only some of my ticked steps in the report?

Because only steps that changed something are listed. Trimming lines that had no leading spaces does nothing, so it does not appear. The count tells you how many steps actually had an effect.

Can it remove non-breaking spaces?

No. Collapse spaces only matches ordinary spaces and tabs, so a non-breaking space between words survives. Find and replace can remove them one at a time if you paste the character into the search field.

Does find and replace support patterns?

No. It is a literal search that replaces every exact occurrence. There are no wildcards, no case-insensitive mode and no whole-word option, so searching for "cat" also changes "category".

What happens if nothing matches?

The status says "Nothing matched" and you get your text back unchanged. Check which steps are ticked, and remember that steps only apply to what the previous steps left behind.

Is my text uploaded?

No. Everything runs in the browser tab. Nothing is written back to your input until you press Apply, and reloading the page clears the box.