Text cleaner, line sorter, deduplicator and slug generator

Trim and collapse whitespace, change sentence, title or programming case, choose LF or CRLF line endings, sort, deduplicate or reverse lines, and create Unicode or ASCII web slugs and identifiers.

FluffyShield Protected workspace
From
To

Convert to

Choose text conversion

FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

How it works
  1. Choose From and To
  2. Paste text into Input
  3. Compare the Result with your original
  4. Copy or download the result

What it does

Spacing

Trim the edges of a passage, or shrink every gap between words to one space.

Lists

Sort lines with numbers in order, drop exact or loose repeats, or do both at once.

Case and labels

Change capitalization, or turn a title into a web-address slug or a name for code.

Limits One change at a time; your original stays in Input.

Extra gaps, repeated lines, or a title that needs to be a web address?

FluffyBench's Text cleaner gives each of those its own choice under To. Paste your text, and the cleaned copy appears next to your original.

Each choice changes one kind of thing, so you can see exactly what it did before you copy the result.

Which spacing fix does your text need?

Picture your pasted text as a page with a margin. Trimmed text cuts the margin: spaces, tabs and empty lines at the very start and very end of the whole passage go, and nothing inside it moves. Collapsed spaces works between the words instead: every run of spaces or tabs becomes one space, everywhere, and every line break stays.

Here's one pasted note cleaned both ways, with every blank made visible.

A pasted note with a blank first line, three spaces before each line, a double tab and runs of spaces. Trimmed text removes the blank first line and the spaces at the very start and end, but keeps the double tab, the run of spaces and the three spaces before Bring. Collapsed spaces turns every run into one space and keeps the blank first line and all three line breaks.
Trim only touches the outside of the whole passage, so the indent before “Bring” survives. Collapse fixes every gap but keeps every line break, even the empty first line. How we measured

Cleaning up spacing in FluffyBench

Here's the whole job on a phone, from picking Collapsed spaces to copying the result. Every other choice under To works the same way.

  1. Tap To and choose Collapsed spaces. Each choice changes one thing, so pick the one that matches what's wrong.

  2. From stays on Text for spacing, case and labels. Switch it to Lines only when you're tidying a list.

  3. Paste your text into Input; the Input tab keeps your original. The result is ready as soon as you paste; there's no button to press.

  4. Open Result and compare it with your original: one space per gap, both lines still there, and a count that drops as gaps shrink. If the wrong thing changed, pick another To; your text stays in Input.

    The Result tab, outlined, shows the note with single spaces, still on two lines, and a 45-character count.
    The Result tab, outlined, shows the note with single spaces, still on two lines, and a 45-character count.
  5. Copy puts the cleaned text on your clipboard; Download saves it as a text file.

How do you sort a list or remove repeated lines?

Switch From to Lines, and the tool treats each line as one item. Unique lines drops later exact copies of a line and keeps your order. Remove duplicate lines (ignore case and end spaces) also ignores letter case and spaces or tabs at the ends, and keeps the first spelling. Sorted A → Z and Sorted Z → A reorder the whole list and keep repeats; a run of digits is compared as a number, so item 9 comes before item 10. Unique + sorted does both, and Reversed lines flips the order without sorting.

Here's one short list under the three main choices.

pearapplerepeatpear

Your list

pearapple

Unique lines

applepearpear

Sorted A → Z

applepear

Unique + sorted

Unique lines keeps the first copy and your order; sorting can scramble a list whose order matters, like recipe steps. Sorting uses your browser's text order, with a run of digits compared as a number, and doesn't trim lines first.

Lines must match exactly to count as repeats.

Appleapplepear·pear

Your list

Appleapplepear·pear

Unique lines

Nothing is removed: a capital letter or a trailing space (·) makes a line different.

Here's the same job in the tool, with a guest list that has one name twice.

  1. Tap From and choose Lines, so each line counts as one item.

  2. Then tap To and pick what should happen to the list. Choose Unique + sorted for both.

  3. Paste the list into Input, then open Result. The second Marco is gone and the names are in A-to-Z order.

    The Result tab, outlined, lists Aiko, Ben, Marco and Priya, one per line.
    The Result tab, outlined, lists Aiko, Ben, Marco and Priya, one per line.

How do you change capitalization?

Lowercase and Uppercase change every letter. Capitalized words lowers everything first, then gives each run of letters a capital, so it can't tell an apostrophe or a name like McDonald from any other word.

Sentence case lowers everything, then capitalizes the first letter of each sentence and each paragraph. Names and the word I stay lowercase, so check those by hand. Title Case capitalizes each word but leaves small words like and, of and the in lowercase mid-title, and keeps an acronym such as NASA as you typed it.

The programming styles work line by line. Each line is split into words at spaces, punctuation and changes of case, then joined the chosen way, so user name becomes userName in camelCase, UserName in PascalCase, user_name in snake_case, user-name in kebab-case and USER_NAME in CONSTANT_CASE.

Here's one phrase under the first three case choices.

Don't stop, McDonald! becomes don't stop, mcdonald! under Lowercase, DON'T STOP, MCDONALD! under Uppercase, and Don'T Stop, Mcdonald! under Capitalized words, with the T after the apostrophe and Mcdonald highlighted.
Check names and words with apostrophes before you copy a Capitalized words result.

How do you turn a title into a web-address slug?

A slug is the short lowercase label at the end of a web address, like text-cleaner in this page's own address. Unicode slug keeps accented letters and other scripts and joins the words with hyphens. ASCII slug folds accents to plain letters and drops other scripts, giving the usual web slug. ASCII identifier makes a name for code out of plain letters, digits and underscores.

Here's the tool's own Example under the Unicode slug and ASCII identifier choices.

The Example text Café & 你好 — A New Start! becomes café-你好-a-new-start as a Unicode slug and cafe_a_new_start as an ASCII identifier.
Both drop the punctuation and the spaces at the ends. The Unicode slug keeps the accent and the Chinese characters; the ASCII identifier strips the accent and leaves out the Chinese characters.

What if some spaces or line breaks won't go away?

Some characters only look like spaces. Collapsed spaces matches ordinary spaces and tabs, so a no-break space or a zero-width space, which can come along when you copy from a web page or a document, gets through untouched.

Here's a pasted line with both kinds hiding in it, before and after Collapsed spaces.

A pasted line holds a tab, a double space, a no-break space and a zero-width space. After Collapsed spaces the tab and the double space are single spaces, and the no-break space and zero-width space are still there.
Only the purple-shaded blanks change; the two lookalikes come through exactly as they were.

Our guide to invisible characters shows where they come from and how to track them down.

Line breaks follow their own rules. Trimmed text removes empty lines and breaks at the very start and end of the passage, but never the breaks between your lines, and Collapsed spaces keeps every break. Neither one changes the kind of break: LF, the single character Mac and Linux use, or CRLF, the two-character pair from Windows. That's what the two line-ending choices are for.

Here's where the two line-ending choices live, and how to bring in a file without losing its endings.

  1. Line endings have their own two choices under To: LF line endings and CRLF line endings.

  2. Typed or pasted breaks always arrive as LF, and Input marks each break LF. To keep a file's own endings, use Open file instead of pasting.

    The Input pane in a line-ending mode, with Open file outlined and a mark showing each line's ending.
    The Input pane in a line-ending mode, with Open file outlined and a mark showing each line's ending.

Not sure which kind a program wants? Our LF and CRLF guide explains when the difference matters.

Counting or comparing text instead?

The Text cleaner changes your text. If you only want to know how long something is, FluffyBench's Text counter counts words, characters and lines without touching it. To see exactly what changed between two versions, like your original and the cleaned copy, paste both into FluffyBench's Text diff.

Need to count text and lines?

Need to compare two versions of text?

Search FluffyBench