complete.tools

Text Cleaner

Fix messy text with one cleanup at a time: extra spaces, blank lines, line breaks, stray symbols, curly quotes or padding on each line.

What this tool does

Fix messy text with one cleanup at a time: extra spaces, blank lines, line breaks, stray symbols, curly quotes or padding on each line. You fill in these fields: Messy text and Cleanup. It shows clean text and characters removed.

Inputs

  • Messy text: Longer text, up to 20000 characters.
  • Cleanup: Choose one: Fix extra spaces (keep line breaks), Remove blank lines, Join into one line, Remove symbols, Straighten curly quotes, Trim every line. Starts as Fix extra spaces (keep line breaks).

How to use

  1. Type the messy text.
  2. Choose an option for "Cleanup".
  3. Read the result: clean text and characters removed. It appears once every required field has a valid value.
  4. Use the copy button to copy the text.

Worked examples

Example 1. Inputs:

  • Messy text: "Hello world next line"
  • Cleanup: Fix extra spaces (keep line breaks)

Results:

  • Characters removed: 9

How this is worked out: Each line is trimmed and runs of spaces or tabs become one space: " Hello world " (16 characters) becomes "Hello world" (11); the empty line stays; " next<tab>line " (13) becomes "next line" (9). Input 16 + 1 + 1 + 13 = 31 characters, output 11 + 1 + 1 + 9 = 22, so 9 removed.

Example 2. Inputs:

  • Messy text: "a b c"
  • Cleanup: Remove blank lines

Results:

  • Characters removed: 6

How this is worked out: Seven lines: a, empty, two spaces, b, empty, empty, c. Lines with nothing but spaces are dropped, leaving a, b, c. Input is 11 characters (3 letters, 2 spaces, 6 line breaks); output is 5; 6 removed.

Example 3. Inputs:

  • Messy text: "नमस्ते #1"
  • Cleanup: Remove symbols

Results:

  • Characters removed: 1
  • Note: Letters of any language with their accents, digits, spaces, line breaks and the marks , . ! ? - ' are kept, along with curly apostrophes. Everything else is removed.

How this is worked out: Reviewer vector. The Hindi word is 6 characters: three letters, the virama U+094D, a letter and the vowel sign U+0947. The virama and vowel sign are combining marks that belong to the letters, so they are kept. Only # is removed: 9 characters in, 8 out.

Example 4. Inputs:

  • Messy text: "“Don’t,” she said, ‘go’."
  • Cleanup: Straighten curly quotes

Results:

  • Characters removed: 0

How this is worked out: Curly double quotes U+201C and U+201D become ", curly single quotes U+2018 and U+2019 become '. Five quote marks change (two double, three single); the count of characters is unchanged, so 0 removed.

Limitations

  • Runs one cleanup at a time.
  • Remove symbols also removes underscores, brackets, currency signs, double quotes, long dashes, emoji and similar marks.
  • Characters removed is the length of the input minus the length of the result. Swapping one character for another, as straightening a quote does, counts as 0.
  • Remove blank lines also drops lines that hold only spaces or tabs.
  • Only the common curly quotes are straightened, not guillemets or other quotation marks.

FAQs

Q: Why one cleanup at a time?
A: Each cleanup is separate so you can see exactly what changed. Copy the result back into the box and pick another cleanup to chain them.
Q: Does removing symbols delete accented letters?
A: No. Letters of any language and all digits are kept, along with spaces, line breaks, the marks , . ! ? - ' and curly apostrophes.
Q: What is the difference between fixing spaces and joining into one line?
A: Fixing spaces keeps your line breaks, trims each line and turns each run of spaces or tabs into one space. Joining turns each run of line breaks into a single space.
Q: Which quotes are straightened?
A: Curly single quotes and curly double quotes, including the apostrophe in contractions.

Explore Similar Tools

Explore more tools like this one: