Skip to content

Text Cleaner & Formatter

Fix broken lines from PDFs, strip extra spaces and invisible characters, change case, tidy lists and count words and characters, all in one place.

  • Fix PDF line breaks
  • Strip hidden characters
  • Case, quotes & sorting
  • Word · X · SMS counts
  • On your device, nothing uploaded
Quick start

0 characters · 0 words

Counts and limits

Words
0
Characters
0
Without spaces
0
Sentences
0
Paragraphs
0
Lines
0
Reading time
0 s
Speaking time
0 s
File size (UTF-8)
0 B
Longest line
0 col
X (Twitter) post0 / 280

Links count as 23, CJK characters and emoji as 2.

Instagram caption0 / 2,200
SMS · GSM-7 · 0 messages0 / 160
Meta description (search snippet)0 / 160
Page title (search result)0 / 60
LinkedIn post0 / 3,000

Hashtags

No hashtags yet. Type keywords or use text that contains #tags. Duplicates are merged regardless of capitals.

Quick start

Line breaks and paragraphs1
Spaces and punctuation3
Letter case
Remove
Find and replace

Rules run in order, after the clean-up above. Type \n in the replacement for a new line. With .* on, use $1 for groups.

Lines and lists

{n} in the before or after text becomes the line number.

Wrap lines to a width

How to use the Text Cleaner & Formatter

  1. Paste your text, drop a .txt, .md, .html or .csv file, or click Sample to try it.
  2. Pick a quick-start preset, such as Fix text copied from a PDF or Tidy a list, or switch on the exact options you need on the left.
  3. Watch the result update as you type. The Changes tab highlights every edit, and Hidden characters shows invisible spaces in the original.
  4. Add find-and-replace rules, sort or de-duplicate lines, change the case or wrap lines to a width if needed.
  5. Copy the result, copy it with formatting for a blog or email editor, or download it as a .txt file.

What the Text Cleaner can do

Line breaks: join hard-wrapped lines while keeping paragraphs and lists, put one sentence on each line, or remove every break. Spaces and punctuation: remove invisible characters, double spaces and spaces before commas, and switch between straight and curly quotes, hyphens and proper dashes, three dots and the ellipsis character.

Lists: delete or keep lines that contain certain words, strip bullets, remove duplicate lines, sort naturally so item 2 comes before item 10, and add text or numbers to every line. Find and replace takes as many rules as you like, with whole-word, match-case and regular-expression options and a live match count.

Counts: words in any language (including Chinese and Japanese, which have no spaces), characters as you see them (an emoji is one), sentences, paragraphs, reading and speaking time, and the limits of X, Instagram, SMS, LinkedIn and search snippets. Hashtags: collect the tags already in your text or turn keywords into tags, without duplicates.

Frequently asked questions 7

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

Choose "Fix text copied from a PDF". Lines inside a paragraph are joined with a space, words split by a hyphen at the end of a line are put back together, and blank lines, bullet points and short lines that end a sentence keep their breaks, so paragraphs and lists stay intact.

What are hidden characters and why remove them?

Text copied from websites, Word or chat apps often carries invisible characters: zero-width spaces, no-break spaces, soft hyphens and direction marks. They break searches, spreadsheets, code and character counts. The Hidden characters tab shows each one with its name, and the clean-up option removes them or turns them into normal spaces.

How is the X (Twitter) length counted?

The counter follows X's own rules: every link counts as 23 characters, most Latin letters and punctuation count as 1, and Chinese, Japanese and Korean characters and emoji count as 2, against a limit of 280.

Why does my SMS count as two messages?

A single SMS holds 160 characters of the basic GSM alphabet. One emoji or non-Latin letter switches the whole message to Unicode, which holds only 70. Longer messages are split into parts of 153 or 67 characters. The counter shows which encoding your text needs.

What does "Even line lengths" do when wrapping?

Normal wrapping fills each line as far as it can, which can leave a very short last line. Even line lengths keeps the same number of lines but spreads the words so every line is about as long as the others, which looks much better when the text is centered, for example in blog posts read on phones.

Does Title Case ruin abbreviations like NASA?

No. Words with capitals inside them, such as NASA, iPhone or McDonald, are left as they are. Short words such as a, of and the stay lower case inside a title. If the whole text is written in capitals, it is treated as shouting and converted normally.

Is my text uploaded or saved anywhere?

No. All processing happens in your browser. If "Keep my text on this device" is ticked, the text is stored only in this browser so it is still there when you come back; untick it or click Clear to remove it. Signed-in history keeps only your settings, never the text.

More free tools