The tool you need, ready to use

Text Cleaner

Paste your text and it removes duplicate lines, repeated spaces, blank lines and invisible characters such as NBSP and zero-width spaces, marking every change in color. It joins lines that a PDF cut mid-sentence and keeps spreadsheet columns intact while trimming the spaces inside cells.

Last updated 2026-10-22All math stays in your browser
Examples

Characters removed

0chars

What was removed

  • Kept
  • Spaces
  • Hidden characters
  • Joined lines
  • Blank lines
  • Duplicates

Result

Clean-up options Line breaks on save

Spaces

Hidden characters

Lines

Last updated 2026-10-22Your inputs are not stored

ROBERIN standardThe tool you need,
ready to use.
  • Clear at a glanceInputs and results sit where you expect them.
  • Result firstThe key number comes first; the working only when you need it.
  • Ask lessNo sign-up and no unnecessary details.

Paste your text and it is cleaned at once, with every change shown like a proof

The text cleaner removes the junk that comes along when you copy text from a web page, a PDF, a chat or a spreadsheet: lines that appear several times, spaces at the ends of lines, words separated by two or three spaces, strings of blank lines, and the invisible characters (non-breaking spaces, zero-width spaces, direction marks) that throw off character counts and searches. Lines that a PDF cut in the middle of a sentence can be joined back into paragraphs.

The result appears as you type. The Changes view lays the edits over your original text in color: removed spaces show as dots, hidden characters show as small labels such as NBSP or ZWSP, and a removed duplicate line is struck through with a tag like "=3" that gives the number of the line that was kept. The bar above the text shows how much of the source went where, so you can see whether anything you wanted to keep was removed before you copy. Text and files are processed in this browser only and are never sent to a server or stored.

Why copied text gets messy

When you paste text somewhere new, things you could not see on the original screen come along. Web pages use non-breaking spaces (NBSP, the HTML entity  ) to stop lines from wrapping. PDFs add a line break at the end of every line you saw on screen. Chat apps and social networks can add zero-width spaces or direction marks. A file name copied from an older Mac can arrive with its accented letters split into a letter plus a separate accent.

None of this shows on screen, but it breaks real work. In a spreadsheet, "Madrid" and "Madrid " count as different values, so removing duplicates and lookups such as VLOOKUP fail. Two lists that look the same report different character counts. A keyword you pasted into a search box finds nothing. A file uploaded to a business system is rejected with a format error. This table shows what usually comes from where.

What comes along, by source
Copied fromWhat comes alongTypical problemOption to use
Web pageNBSP, trailing spaces, several blank linesExcel TRIM does not remove it, values do not matchOdd spaces → space, Edge spaces
PDFA line break at the end of every printed lineSentences arrive cut in the middleJoin broken lines (preset: Join paragraphs)
Chat or social appZero-width space (ZWSP), direction mark (LRM), narrow space (NNBSP)Two identical-looking lines count as differentRemove hidden, Odd spaces → space
Excel or Google SheetsSpaces at the edges of cells, repeated rowsThe same name is counted twiceEdge spaces (also applied at cell edges), Remove duplicates
Mac file names, some documentsLetters split into base letter plus accent (NFD)"café" does not match a search for "café"Recompose letters

How to use it

  1. Paste your text into the source box, or drop a text file (TXT, CSV, MD) onto it. The result updates as you type.
  2. Pick a preset (Basic, List, Join paragraphs or Hidden only) in the options panel, then switch single options on or off. The number beside each option is how many changes it made in this text.
  3. In the Changes view, check what was removed. Hover over an option, or move to it with the keyboard, and only the changes made by that option stay highlighted.
  4. Copy the result or save it as a TXT file. If Windows Notepad or a business system needs CRLF line breaks, set the line break format to CRLF first.

The options at a glance

Cleaning runs in the order of the table. Characters are fixed first, then spaces, and finally lines are joined, de-duplicated and trimmed. That is why a line with an NBSP and the same line with a normal space count as the same line once the spaces are cleaned.

What each option does, and its default
OptionWhat it doesDefault
Recompose lettersJoins a letter and its separate accent into one character, and split Hangul letters into syllables (NFC).On
Remove hiddenDeletes zero-width spaces, word joiners, BOM, soft hyphens, direction marks, Hangul filler characters and control characters. Line and paragraph separators (LS, PS, VT, FF) become line breaks.On
Odd spaces → spaceTurns NBSP, narrow no-break spaces (NNBSP), em and en spaces and similar into a normal space.On
Tabs → spacesTurns each tab into one space. When off, tabs are treated as column separators and kept.Off
Edge spacesRemoves spaces at the start and end of each line, and on both sides of a tab (the edges of a cell). "End only" keeps indentation.Both ends
Collapse spacesReduces runs of two or more spaces between words to one. Indentation at the start of a line is left alone.On
Join broken linesJoins the lines inside a paragraph (paragraphs are separated by blank lines). Lines that start with a list marker, a number or a # heading are not joined.Off
Remove duplicatesKeeps the first occurrence of a line and removes later copies. "Adjacent" removes only a line repeated right after itself.All
Trim blank lines"Keep one" reduces a run of blank lines to one and removes blank lines at the start and end. "Remove all" deletes every blank line.Keep one

The four presets set these options for a purpose. List removes all blank lines and duplicate lines, which suits keyword, product and email lists. Join paragraphs joins broken lines with a space and keeps duplicate lines, which suits PDF and email text. Hidden only leaves spaces and lines alone and fixes only hidden characters, special spaces and split letters, which suits code, poems and Markdown where the layout matters.

Invisible characters it handles

The characters below show nothing on screen, or look exactly like a normal space. In the Changes view each one gets the label in the second column, and hovering over the label shows its Unicode number and name. A dashed label is a deleted character, a solid label is a character replaced by a normal space.

Characters it cleans and characters it leaves
CodeLabelWhat it isAction
U+00A0NBSPNo-break space. Comes from   in web pages.To space
U+202FNNBSPNarrow no-break space. Used before French punctuation and between a number and its unit.To space
U+2000 to 200A, 205F, 1680ENSP, EMSP, THSP, etc.Typographic spaces of fixed width, math spaceTo space
U+200BZWSPZero-width space. Only marks a place where a line may break.Deleted
U+2060WJWord joiner. Stops a line from breaking at that point.Deleted
U+FEFFBOMByte order mark at the start of a file. Junk when it appears inside text.Deleted
U+00ADSHYSoft hyphen. Appears as a hyphen only if a line breaks there.Deleted
U+200E, 200F, 061C, etc.LRM, RLM, LRI, PDIText direction marks and direction isolatesDeleted
U+3164, etc.HF, HCF, HJFHangul filler characters. Used for "blank" usernames and fake spaces.Deleted
U+0000 to 001F, etc.BS, ESC, DELControl characters (except tab and line breaks)Deleted
U+2028, 2029, 0085, VT, FFLS, PS, NEL, VT, FFLine and paragraph separators, and line or page breaks from some word processors and PDF extractionTo line break
U+200D(none)Zero-width joiner. Glues emoji into one picture.Kept
U+3000(none)Ideographic space. A normal character in Japanese and Chinese text.Kept

The zero-width joiner (ZWJ) is not deleted. It is what combines emoji such as family or profession emoji into a single picture, and without it they fall apart into separate emoji. The ideographic space (U+3000) stays because Japanese and Chinese documents use it on purpose for indentation. To turn it into a normal space, use a full-width/half-width converter.

Letters split into a base letter and an accent

"é" is normally one character, U+00E9. The same letter can also be stored as two: a plain "e" (U+0065) followed by a combining acute accent (U+0301). The first form is called NFC and the second NFD, and Unicode treats them as the same letter. Programs, however, compare them as different strings. A search for "café" misses the NFD spelling, the text has one more code point than it appears to, and some systems draw the accent in the wrong place or on its own.

The usual source is the Mac. HFS Plus, the older Mac file system, stores file names fully decomposed, so a name or a text that includes such a name often contains NFD letters. The same thing happens to Korean: a syllable such as "한" can be one character (U+D55C) or three conjoining letters (U+1112, U+1161, U+11AB). This tool recomposes only letter-plus-mark sequences and split Hangul. It does not normalize the whole text, because that would also replace compatibility characters such as the ohm sign (U+2126) or the compatibility ideograph U+F914 with different characters. Those stay exactly as they were.

Split letters before and after
Input (as it looks)Code pointsResult
café, with the accent stored as a separate markU+0063 U+0061 U+0066 U+0065 U+0301café (U+00E9)
Korean "한글" shown as loose lettersU+1112 U+1161 U+11AB U+1100 U+1173 U+11AF한글 (two syllables)
Ohm sign (a look-alike of Greek omega)U+2126Unchanged (U+2126)

How broken lines from a PDF are joined

A PDF stores text line by line, so copying it brings a line break at the end of every printed line. Join broken lines treats a blank line as the border of a paragraph and joins the lines inside it. What goes between two joined lines depends on the characters at the break.

  • With space: for languages written with spaces, such as English and Spanish, one space goes between the lines. This fits PDFs that break at word boundaries.
  • No space: for text that was cut in the middle of a word, the lines are glued without a space.
  • If a Japanese kana or Chinese character, or a full-width punctuation mark, sits at the break, no space is added in either mode.
  • If a line ends with a letter and a hyphen and the next line starts with a lowercase letter, the lines are glued without a space and the hyphen is kept (inter-national). This avoids damaging real compounds such as well-known.
  • With Edge spaces off or set to End only, a space can be left at the break (spaces at the end of the previous line or the indentation of the next one). If Collapse spaces is on, that space is reduced to one and the lines are joined with it, so indented lines do not leave a gap in the middle of a sentence.
  • If the next line starts with a list marker, a number or a Markdown heading (-, *, +, a bullet, 1., 1), (1), a), A., I., #, >), it is not joined. A list item that wraps onto a second line is joined, because the second line has no marker.
Joining results (↵ is a line break)
InputModeResult
The meeting is at 2 PM↵in the main building.With spaceThe meeting is at 2 PM in the main building.
Please confirm your atten↵dance.No spacePlease confirm your attendance.
We hired an inter-↵national team.With spaceWe hired an inter-national team. (hyphen kept)
準備物は↵ノートです。With space準備物はノートです。 (no space added)
Agenda:↵- budget↵- scheduleWith spaceUnchanged (list lines are not joined)

If a title gets glued to the first line of the body, add a blank line after the title in the source and check again. Joining decides paragraph borders by blank lines only.

Removing duplicates: all lines or adjacent only

Remove duplicates compares lines after spaces and hidden characters have been cleaned. When a line appears again, the first one is kept and the later one is removed. The order of the remaining lines never changes. Blank lines are not compared as duplicates; the Trim blank lines option handles them. In the Changes view, a tag such as "=2" next to a removed line means it matches line 2 of the result.

The same four lines (Paris, Paris, Rome, Paris)
ModeResultBest for
AllParis / RomeKeyword, product or email lists where each entry should appear once
AdjacentParis / Rome / ParisDocuments with accidental repeated lines, or records where order matters
All + Aa (ignore case)AppleEntries that differ only in upper and lower case

Lines with different spacing are different lines. "summer dress" and "summerdress" do not become equal. On the other hand, "summer dress" (two spaces) and "summer dress" become the same line when Collapse spaces is on.

Pasting spreadsheet rows

When you copy several cells from Excel or Google Sheets, the cells are separated by tabs. By default this tool keeps tabs as column separators and removes spaces at the edges of each cell, not only at the end of the line. So the spaces in "Anna ⇥ Sales ⇥" disappear and the columns stay aligned. An empty cell keeps its tab, so the columns do not shift.

One table row (⇥ is a tab, ␣ is a space)
InputTabs → spacesResult
Anna␣⇥␣Sales␣⇥555-0100␣OffAnna⇥Sales⇥555-0100
Anna⇥⇥555-0100 (middle cell empty)OffAnna⇥⇥555-0100
Anna␣⇥␣SalesOnAnna␣Sales (column separator lost)

If Tabs → spaces is on while you paste a table, the status line warns that the columns are gone, and "Keep tabs" undoes it with one click. If the same row was pasted twice, Remove duplicates keeps one copy.

How it differs from Excel TRIM and CLEAN

Excel has TRIM for spaces and CLEAN for non-printing characters. Both were designed around 7-bit ASCII, so they leave much of what comes from the web. Microsoft's help pages say that TRIM does not remove the non-breaking space (character 160), and that CLEAN does not remove the extra non-printing characters 127, 129, 141, 143, 144 and 157.

What Excel functions and this tool remove
TargetExcel TRIMExcel CLEANText cleaner
Leading, trailing and repeated spaces (code 32)RemovedStaysRemoved
NBSP (160)StaysStaysTurned into a space, then cleaned
Control characters 0 to 31StayRemovedRemoved (except tab and line breaks)
127, 129, 141, 143, 144, 157StayStayRemoved
Zero-width characters such as ZWSP, BOM, LRMStayStayRemoved
Duplicate lines, blank linesNot applicableNot applicableRemoved

Inside Excel, replace the NBSP with a normal space first and then apply TRIM: =TRIM(SUBSTITUTE(A1,UNICHAR(160)," ")). To clean a whole column at once, copy it, paste it into this tool and paste the result back. Turn off Trim blank lines and Remove duplicates if the number of rows must stay the same.

LF and CRLF line breaks

A line break is stored in a file as LF (one character) or as CRLF (carriage return plus line feed, two characters). Mac, Linux and the web use LF. Older Windows programs and some business systems expect CRLF. In 2018 Microsoft changed Windows Notepad so that it also shows files with LF line endings correctly, and said that new files created in Notepad still use CRLF by default.

On screen the tool treats both the same way. It converts to the format you choose under "Line breaks on save" only when you copy or save. Opening a CRLF file switches the save format to CRLF automatically. Since both look identical on screen, change it only if the receiving program asks for a specific format.

Common mistakes

  • Repeated sentences disappeared: the Basic preset removes duplicates across the whole text. If you repeat a line on purpose, such as "Thank you.", check the struck-through lines in the Changes view and switch Remove duplicates off or to Adjacent.
  • Code indentation is gone: with Edge spaces on "Both ends", indentation is removed. For code and poems choose "End only" or use the Hidden only preset.
  • Markdown line breaks disappeared: Markdown reads two spaces at the end of a line as a line break. For such text turn off Edge spaces.
  • A list got merged into one line: Join broken lines treats lines without markers (one keyword per line) as a paragraph. Do not turn it on for lists.
  • Table columns shifted: Tabs → spaces removes the column separators. Leave it off for tabular data.
  • "Nothing to fix", but the text still looks odd: ideographic spaces (U+3000) and zero-width joiners are kept on purpose. Use a full-width/half-width converter for the ideographic space.

Limits

  • It does not correct spelling or grammar, and it does not compare meaning. Two lines are duplicates only if their characters are exactly the same.
  • Join broken lines separates paragraphs only by blank lines and list markers. It does not recognize page numbers, headers and footers, tables or two-column layouts in a PDF, so check the result.
  • Hyphens are never deleted. A word split at a line end with a hyphen (inter-national) needs the hyphen removed by hand.
  • The source can have up to 500,000 characters and a file up to 4 MB. The Changes view draws only the first 1,500 lines or 40,000 characters; copy and save always use the full result.
  • HTML tags are treated as ordinary text. Use an HTML tag remover first if you need to strip them.
  • It does not change the shape of visible characters such as curly quotes, dashes or full-width letters and digits.

Basis: the behavior of the Excel functions comes from Microsoft's official help pages, and the meaning of Unicode characters from the Unicode 18.0 specifications (UAX #15, core specification chapter 23, UTS #51), both read in the original on 22 October 2026. The results in the tables were re-run through this page's own cleaning code and matched.

Sources

Frequently asked questions

How do I remove duplicate lines?

Paste the text and the Basic preset keeps the first occurrence of each line and removes later copies. The order of the remaining lines does not change, and the Changes view marks each removed line with the number of the line that was kept. To remove only a line repeated right after itself, choose Adjacent under Remove duplicates.

Why does Excel TRIM not remove some spaces?

Usually they are non-breaking spaces (NBSP, character 160) that came from a web page. TRIM is built to remove only the normal space, character 32. This tool first turns NBSP and other special spaces into normal spaces, then removes the spaces at the edges and the repeated ones.

How do I remove line breaks from text copied from a PDF?

Click the Join paragraphs preset or switch on Join broken lines. Paragraphs separated by a blank line stay separate, and only the lines inside each paragraph are joined. If lines are cut in the middle of words, choose No space. Lines that start with a list marker or number are not joined.

How can I see whether text contains invisible characters?

Paste it and open the Changes view. Deleted zero-width spaces, BOMs and direction marks appear as dashed labels such as ZWSP or LRM, and special spaces replaced by a normal space appear as solid labels such as NBSP. Hover over a label to see its Unicode number and name.

My accented letters look split into a letter and an accent. How do I fix it?

The text is stored in decomposed form (NFD), common in file names from older Macs. With Recompose letters on, each letter and its separate accent are joined into one character (NFC). Compatibility characters are left untouched so they are not replaced by different ones.

Are the columns kept when I paste a spreadsheet table?

Yes. Tabs are kept as column separators and only spaces at the edges of each cell are removed. An empty cell keeps its tab, so columns do not shift. Turning on Tabs → spaces removes the separators, so leave it off for tabular data.

Should I choose LF or CRLF?

The default LF is fine for Mac, Linux and the web. Switch the save format to CRLF only if an older Windows program or a business system requires it. Opening a CRLF file sets the save format to CRLF automatically.

Is the text I paste sent to a server?

No. Cleaning happens in this browser only. The text and files are not sent to a server, and are not kept in the address bar or in browser storage. The source can have up to 500,000 characters and a file up to 4 MB.