Illustration of words spread apart by uneven gaps being pushed back together

Text & writing

Why Text Gets Extra Spaces

Extra spaces are one of the most common problems in pasted text: double spaces between words, spaces at the start of lines, or gaps that make copied text look uneven. They almost always come from how the text was produced or copied. This guide explains the usual causes.

Ready to try the tool this guide describes?

Typing habits

  • Two spaces after a period, a habit from typewriters.
  • Using the space bar to indent or to line up text in columns instead of tabs or tables.
  • Accidental double spaces, which are easy to miss in proportional fonts.

Copying from PDFs and layouts

Justified text in PDFs is spread across the line with varying gaps between words. When the text is extracted, those gaps can become several spaces. Text laid out in columns or tables can also come out with runs of spaces where the layout had space.

Web pages and rich text

Web pages often use non-breaking spaces to control layout. They look like normal spaces but are a different character, and they can survive copying and pasting. Rich text editors may also add them when you type several spaces in a row.

Why it matters

  • Uneven spacing looks unprofessional in documents and messages.
  • Extra spaces break exact matching when you search, compare, or remove duplicates.
  • Leading and trailing spaces can cause errors in forms, spreadsheets, and data imports.

Why Text Gets Extra Spaces FAQ

Why does copied PDF text have double spaces?
Justified and laid-out text is spread with variable gaps, and extraction can turn those gaps into several spaces.
Why do I have spaces at the start of lines?
They usually come from indentation made with the space bar, or from layout spacing in the source document.
Are extra spaces a problem in spreadsheets?
Yes. A value with a trailing space does not match the same value without it, which breaks lookups and comparisons.
Why can’t I see some spaces?
Trailing spaces sit at the end of a line and are invisible unless the editor shows whitespace characters.
Do non-breaking spaces count as extra spaces?
They are spaces, so repeated non-breaking spaces are extra spacing too, even though they are a different character.

Related guides

Open the tool

Jump into Remove Extra Spaces when you are ready to process your files.

← Back to all guides

More from Looty

Explore Looty’s Ecosystem

Discover more ways Looty can help you learn, organize, create, and make an impact.