Replace multiple consecutive spaces with a single space

Please log in or register to do it.

This tool replaces multiple consecutive spaces with a single space. It provides flexible options so you can replace every instance of consecutive spaces, replace only those following specified characters, replace all except those following allowed characters, or replace them with a custom formatted string. Simply enter your text and select the processing mode that suits your needs.

Processing Modes:


Replaces every occurrence of two or more consecutive spaces with a single space.

Replaces only the multiple spaces that immediately follow the characters you specify. Enter a comma‑separated list (e.g., a, b).

Replaces every occurrence of multiple spaces with a single space except when they immediately follow any of the allowed characters you specify. Enter a comma‑separated list (e.g., x, y).

Replaces every occurrence of multiple spaces with a custom formatted string. Use {space} as a placeholder for a single space (default replacement is " ").

Examples:

Replace All Multiple Spaces

Every instance of two or more consecutive spaces is replaced with a single space.

Before:
This   is  a    test.
After:
This is a test.

Replace Only Multiple Spaces After Specified Characters

Only the multiple spaces immediately following specified characters are replaced. (e.g., specifying "t" will affect spaces after "t")

Before:
cat   dog  mouse
After (specifying "t"):
cat dog  mouse

Replace All Except Spaces Following Allowed Characters

Replaces every occurrence of multiple spaces with a single space except when they follow allowed characters (e.g., allowing "s" to remain unchanged).

Before:
this   is  a   sample
After (allowing "s"):
this   is a sample

Replace Multiple Spaces with Custom Format

Every occurrence of multiple spaces is replaced using a custom format (e.g., replacing with "[{space}]").

Before:
example    text
After (format "[{space}]"):
example[{space}]text
Replace dollar signs with 'USD'
Replace Base64 encoded text with its decoded version

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