Menu

Need training at your office? Request a quote for custom training.

Home / Adobe InDesign / Adobe InDesign: Removing Unwanted Spaces, Fast!

Adobe InDesign: Removing Unwanted Spaces, Fast!

By Barb Binder, Adobe Certified Instructor on InDesign
Updated April 22, 2016

Too many extra spaces in your InDesign documents? No problem. You can quickly and (painlessly) remove extra spaces by running one or more Find/Change queries. The three I am going to show you are using GREP, which uses patterns instead of actual character strings to locate and fix issues in InDesign documents.

  1. Place all your files into the InDesign document. (I place stories on the Pasteboard when I’m not ready to place them on the actual pages.)
  2. Choose Type > Show Hidden Characters so that you can see the non-printing characters.
    Adobe InDesign: Example of extra spacing.
  3. Chose Edit > Find/Change.
  4. Drop down the Query list on the top line and run each of these queries with the Search parameter set to Document (to search all the stories in the InDesign document):
    1. Multiple Space to Single Space. Instead of running a series of searches to weed out all extra spaces, just pick this one preset. The Find What line looks a little scary, so just don’t look too closely. If you simply can’t look away, understand that it’s a string of GREP characters that looks for two or more spaces (i.e., em spaces, en spaces, flush spaces, hairspaces, etc.) and replaces all of those with one spacebar space. Hit Change All and poof! All extra spaces are gone.
      Adobe InDesign CC: Removing Extra Spaces
    2. Multiple Returns to Single Return. Another preset, this one pulls out all two or more hard returns and replaces with one.
      Adobe InDesign CC: Removing Extra Spaces
    3. Remove Trailing Whitespace. Trailing whitespace refers to one or more spaces, tabs or extra returns at the end of a paragraph, between the final punctuation and the hard return(s). When it’s just a single space, most of the time they don’t cause any problems, but sometimes they won’t fit on the same line as the punctuation and they force a new line or even a new page. For long documents, this can be a real nightmare. This query also picks up the double returns and even multiple spaces (but only when the spaces are at the end of a paragraph) so I tend to run this one first.
      Adobe InDesign CC: Removing Extra Spaces
      Adobe InDesign: Extra spacing removed.

For more information and a list of GREP characters, see InDesign Help / Find/Change.

Leave a Reply to Tiago Cancel reply

Your email address will not be published. Required fields are marked *

44 thoughts on “Adobe InDesign: Removing Unwanted Spaces, Fast!

  1. Hello,

    To complete this interesting post, we can remove unwanted spaces between double characteres as parenthesis, braces, brackets, etc. with a lookbehind and a lookahead :

    (?<=[([{])s+|s+(?=[])}])

    In this example, the lookbehind (?<=) looks, in a character class [ ], for an open parenthesis or an open bracket or an open brace followed by one or more spaces. The lookahead (?=) looks for closes characteres preceded by one or more spaces.

  2. Hi Mrolfer: the GREP strings in all three examples are shown as screen shots under the instructions. If you can’t see them for some reason, you can access all three by opening up the Find/change dialog box in InDesign CS3 or CS4. ~Barb

  3. WOW, what a relief to find such a piece of information while you ere desperately looking for it!

    Thanks Barb

  4. Is it possible to find all “tabs” and replace with no space? Actually more specifically, I have two tabs in each line of text. The first tab I would like to replace with no space. The second tab I would like to replace with one space.

    I really appreciate anyone’s incredible knowledge if you have a solution for this as my document has 10751 tabs. 😮

    1. Hi Donetta:

      How about searching for two consecutive tabs, and replacing with a single space? Here’s how to set it up in InDesign:

      Find what: ^t^t
      Change to: (press the spacebar once)

      ~Barb

  5. Love this really, really helpful thanks so much!

    I have a question though. Almost ever time I receive a manuscript from a client, they seem to have manually indented their paragraphs by adding a couple of spaces at the beginning of each one. Is there any quick and simple way to remove these? That way I can use paragraph styles for proper and consistent indentation.

    1. Excellent point, Antony. InDesign has a query for removing trailing whitespace, but not leading whitespace.
      There are several ways to do this. Here are two easy ones:

      After you run the “Multiple Space to Single Space” query, create one additional text query:
      Find what: ^p(press the spacebar once)
      Change to: ^p

      This will find the one remaining space at the beginning of a paragraph, and will replace it with a hard return.

      Or, you can just create a GREP query:
      Find what: $s+
      Change to: r

      In either case, save the query as “Remove Leading Whitespace” so that you can just run it in the future.

      ~Barb

  6. I have been in despair with customer’s word documents. Instructions on hard returns and soft returns met with blank incomprehension and still I receive files that almost bring me to tears. Line after line of deleting spaces – on and on.
    Your grep instruction has been such a godsend to me, I don’t know how I found myself on your site, but if you ever brought out a grep app I would pay good money for it. Thank you so much. I can now say “bring it on…bring on your awful word docs”

    BTW have you got any instructions for removing the spaces in lines, when the customer doesn’t know how to tab, so does space-space-space-space?

    1. Hi Elizabeth:

      If the typists are randomly adding the extra spaces mid-paragraph, use the Multiple Space to Single Space GREP query. If they are using spaces between columns that should be tabbed, then search for multiple spaces, and replace with a tab. Cycle back and replace multiple tabs with a single tab. But that’s going to require that you look at each table closely as you update, as the chances for problems are much greater than within paragraphs. Here’s a spot where I’d step in and try to help them prepare the tables correctly before turning them over to me. Good luck!

      ~Barb

      1. Hello,
        I have one problem in indesign paragraph related. When i add new formatting like bold/color in some words, it add leading some blank characters. so extra spaces add in new bold/ color words. How can i remove it.
        Thanks in advance.

  7. thanks SO much. your directions were clear and easy to follow AND you saved me a TON of time!

  8. I have been formatting a 400+ page book that I have written and I am sending it to the printer next week. I have struggled with a number of these issues as I originally wrote the book in Word. I ran the Remove Trailing Whitespace GREP and after I did it, InDesign would no longer output to PDF. It turns out that something corrupted one of my tables when I ran the GREP and clicked change all. I began to output the document several pages at a time and located two offending pages. I was able to rebuild the tables and everything is great now.

    I just did the Remove Leading Whitespace and Parenthetical White Space and did the changes manually and it worked awesome!

    I finished writing the book in April and it has taken me until November to get it all edited and formatted and create the images and cover. I never dreamed that this part of the process would be so time intensive!!!

    I am a dentist and a part time writer and I have come to realize that you professional folks are worth your weight in gold!

    Thanks so much for taking the time to share these tidbits, they are a Godsend!!

  9. I design books and often the authors put a tab at the beginning of their paragraphs. I need to removed them using GREP but don’t remember how. Can you help?

    1. You don’t need GREP for that. Just do a regular text Find/Change:

      Find: ^p^t
      Change: ^p

      This tells InDesign to search for any tab character following a ¶, remove the tab and leave the ¶.

    1. Hi Cade:

      Choose Edit > Find/Change
      Choose the GREP tab at the top of the dialog box
      Find: ^\s
      Change: [leave blank]

      ~Barb

  10. Thanks, been thinking I needed to create a GREP for this but clearly this was there the whole time. Saves from doing the old-fashioned find and replace.

  11. Life saver, I tell my copy guy not to double space anymore your not using a typewriter. But old habits are hard to break. Thank you so much this is so awesome.

  12. I tried to do this with non breaking spaces and it just did it with one- not the whole document?
    what am i doing wrong 🙁