What could cause the spacing issue
If the spacing issue is occurring at the end of a sentence, then it may be caused by an indent issue. The line with the problem will have an extra carriage return before it or after it. One way to fix this is to find the beginning or ending carriage return and delete it. For example, you could find the carriage return before a period at the end of a sentence by opening the file in word. Using the arrow keys, go up on the tab key to “find and replace” and then use your arrow keys to find it. Select it with the left mouse button and then click “replace”.

How to identify and fix the problem
If the spacing issue is occurring between words, then it may be caused by a line feed issue. The lines with the problem have extra spaces between words or before or after words. One way to fix this is to find the line feeds and delete them. Look at the highlighted area in the image below. There are spaces before and after the word are.
There are two spaces before the word are and no space after the word are. This is an example of an extra space before a word. There is normally no space before a word but it can be inserted manually by pressing and holding shift while pressing the arrow key.
To identify where the extra spaces are, one method is to select all the text in your file, then click Format > Paragraphs > Line spacing , then set Spacing After to 0 pt. This method requires no action on your part to fix the spacing issue.

Tips for preventing the issue from happening again
Delete carriage returns and line feeds if they are causing the issue. Make sure that one of those characters is not on a line by itself. (A line feed within a paragraph is fine, but not one after another.) And make sure that the spacing is not caused by an indent issue.Then switch to a different editor.
If you have any other options to use, let me know. In my case I use vim, which allows you to set the minimum width of a line. But I can imagine that other editors would work just as well.
Just to finish this off: here is a line by itself: “This is how to fix weird spacing between words in google docs”. Here’s a fixed version: “This is how to fix weird spacing between words in google docs”.
