ReplaceKit

Remove extra spaces from text

Paste your text and get it back without double spaces, stray spaces at the ends of lines, spaces before commas or odd non-breaking spaces. Free, no sign-up. Your text never leaves this page: the tool runs in your browser and sends nothing anywhere.

Spaces

Also fix

What each option does

OptionWhat changes
Two or more spaces between words become one"Thanks   for  your message" becomes "Thanks for your message". Single spaces are left alone.
Remove spaces at the start and end of every lineTrailing spaces you cannot see and leading spaces left by a copy. Tick "Keep indentation" to keep the leading ones (code, bullet lists).
Turn non-breaking and other odd spaces into normal onesWeb pages, PDFs and Word documents often carry non-breaking spaces (U+00A0), thin spaces and ideographic spaces that look like a space but are not matched by a search for a space. They become a normal space first, so the options above catch them.
Remove spaces before , . ; : ! ? ) and after ("Hello , world !" becomes "Hello, world!". A space before a decimal such as ".5" is left alone.
Remove empty linesBlank lines between paragraphs are removed. Leave it unticked to keep your paragraph breaks.
Remove every spaceFor codes, IDs and phone numbers pasted with gaps ("12 345 678" becomes "12345678"). Line breaks stay.

Tabs count as spaces for every option except "Keep indentation". Only the number of spaces changes: no word, number or punctuation mark is edited or reordered.

Remove extra spaces without a tool

In most editors you can do the same with Find and replace. Search for two spaces, replace with one space, and press Replace all until it reports no matches. With regular expressions on, search {2,} and replace with a single space in one pass; ^ +| +$ replaced with nothing trims line ends. Google Docs has no regular expressions in its own Find and replace, which is why the double-space fix there takes several passes.

Is my text private?

Yes. The tool is one readable script, tool.js (no libraries), which works only on what is in the box. It makes no network requests and stores nothing; you can disconnect from the internet after the page loads and it keeps working. Separately, the page sends one cookie-free page view count when it loads (the page address and the referring site, never your text; see privacy).

In Google Docs: ReplaceKit does this inside the document

Copying text out of a document and back loses its headings, bold and links. ReplaceKit, the Google Docs add-on we are building, has a one-click "Double spaces" cleanup that works in place, only in your selection if you want, with formatting kept and a preview of each match. The same cleanups are on the remove line breaks tool.

ReplaceKit is built and in testing. It is not in the Google Workspace Marketplace yet. Leave your email and we send one message when you can install it.

You're on the list. We'll email you when ReplaceKit is ready.

Free version: every find and replace, no click limit or trial clock.

More free ReplaceKit tools and guides