# Text Cleaner

> Text cleaner: remove extra spaces, empty lines, line breaks and duplicate lines. Fix text copied from a PDF in one click. Free, runs in your browser.

Source: https://widgetpantry.com/en/text-cleaner · Türkçe: https://widgetpantry.com/tr/metin-temizleyici

Paste text copied from a PDF, a web page or an email and remove extra spaces, empty lines, duplicate lines and the line breaks that chop up paragraphs. You choose which clean-ups to apply.

Runs in your browser: files and text are not uploaded. [Use the tool](https://widgetpantry.com/en/text-cleaner)

## How to use it

1. Paste your text.
2. Tick the clean-ups you want; the result updates as you go.
3. Copy the clean text.

## What each option does

Remove extra spaces turns runs of spaces into one and also clears tabs, non-breaking spaces and invisible zero-width characters. Trim spaces at line ends removes spaces at the start and end of every line.

Remove line breaks is for text copied from a PDF: it turns lines broken mid-sentence back into flowing paragraphs. Paragraphs separated by a blank line are kept, and words split with a hyphen at a line end (“exam-” + “ple”) are joined again.

Remove empty lines and remove duplicate lines are handy for lists; only the first copy of a repeated line stays.

## Frequently asked questions

### Why is text copied from a PDF broken into lines?

A PDF places text line by line, so copying it adds a line break at the end of every line. “Remove line breaks” joins them and brings the paragraphs back.

### What happens to words split with a hyphen?

If a line ends in “exam-” and the next starts with a lower-case letter, the hyphen is removed and the word joined. Places that continue with a capital, like “New-York”, are left alone.

### Does removing duplicate lines change the order?

No. The first copy of each line stays where it was and later copies are removed.

### Is my text sent anywhere?

No. The cleaning happens in your browser; your text isn't sent to our server or stored.

## Related tools

- [Word Counter](https://widgetpantry.com/en/word-counter): Instantly count the words and characters in an essay, article or application answer. Characters with and without spaces, sentences, paragraphs and estimated reading time.
- [Case Converter](https://widgetpantry.com/en/case-converter): Case converter: upper, lower, title and sentence case, plus camelCase, PascalCase, snake_case, kebab-case and CONSTANT_CASE for code. Free, runs in your browser.
- [Text Compare](https://widgetpantry.com/en/text-compare): Find the differences between two texts by line and by word, with options to ignore case and whitespace. Your texts stay in your browser.
