User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Quick:
Input
Output
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Text spacing errors cause parsing failures in fixed-width data formats, monospaced terminal layouts, and legacy systems that rely on whitespace-delimited columns. A single missing or extra space in a COBOL copybook or FORTRAN formatted output breaks downstream processing entirely. This tool applies a controlled space multiplication factor n to every whitespace gap in your input, converting each single space into exactly n consecutive space characters (U+0020). It operates on raw Unicode text with no encoding side-effects.

The tool supports four distinct modes: word-gap multiplication (scales existing inter-word spaces), character-level insertion (injects spaces between every glyph), leading/trailing preservation, and tab-to-space expansion before duplication. Note: this tool treats only the standard space character (U+0020). Non-breaking spaces (U+00A0), em-spaces (U+2003), and other Unicode whitespace are passed through unmodified. For inputs exceeding 500,000 characters, consider splitting into chunks to avoid browser memory pressure.

duplicate spaces add spaces text spacing double spaces text formatter space multiplier

Formulas

The core transformation applies a space multiplication factor to every contiguous run of standard space characters found in the input string.

output = replace(input, pattern, replacement)

Where the regex pattern and replacement depend on the selected mode:

Word Gap Mode: pattern = /( +)/g โ†’ each match m is replaced by repeat(m, n)
Character Mode: pattern = /(.)/g โ†’ each character c gets n spaces appended (except last)

Where n = the user-selected multiplier (2 for duplicate, 3 for triple, or any custom integer). For Word Gap Mode, every contiguous block of k spaces becomes k ร— n spaces. The total output length L is calculated as:

L = Lnon-space + S ร— n

Where S = total count of original space characters, and Lnon-space = count of all non-space characters (including line breaks).

Reference Data

Whitespace CharacterUnicodeNameAffected by ToolTypical WidthCommon Use
U+0020SpaceYesVariableStandard word separator
U+00A0No-Break SpaceNoSame as spacePrevents line break
โ€‚U+2002En SpaceNo0.5 emTypography
โ€ƒU+2003Em SpaceNo1 emTypography
โ€„U+2004Three-Per-Em SpaceNo0.33 emThin spacing
โ€…U+2005Four-Per-Em SpaceNo0.25 emThin spacing
โ€†U+2006Six-Per-Em SpaceNo0.167 emFine typography
โ€‡U+2007Figure SpaceNoDigit widthTabular number alignment
โ€ˆU+2008Punctuation SpaceNoPeriod widthAfter punctuation
โ€‰U+2009Thin SpaceNo0.2 emSI unit separator
โ€ŠU+200AHair SpaceNoThinnestKerning adjustment
โ€ฏU+202FNarrow No-Break SpaceNoNarrowFrench punctuation
ใ€€U+3000Ideographic SpaceNo1 CJK charCJK text formatting
\tU+0009Horizontal TabOptional4 - 8 spacesCode indentation
\nU+000ALine FeedNoN/ALine break (Unix)
\r\nU+000D+U+000ACRLFNoN/ALine break (Windows)

Frequently Asked Questions

No. The tool exclusively targets the standard ASCII space character (U+0020). Non-breaking spaces (U+00A0), em spaces (U+2003), thin spaces (U+2009), and all other Unicode whitespace categories pass through unchanged. If you need to normalize these first, convert them to standard spaces before processing.
In Word Gap mode, the tool treats each contiguous block of spaces as a single unit and multiplies its length by the factor n. For example, if your text has 3 consecutive spaces and you set the multiplier to 2, the output will contain 3 ร— 2 = 6 spaces. This is multiplicative, not additive.
Word Gap mode only modifies existing spaces between words - it multiplies each space gap by the chosen factor. Character mode inserts n spaces between every single character in the text, regardless of whether a space existed there originally. Character mode dramatically increases output length: a 100-character input with multiplier 2 produces roughly 298 characters.
Yes. Line breaks (LF, CRLF) are fully preserved and never modified. Tabs (U+0009) are preserved by default unless you enable the "Convert tabs to spaces first" option, which replaces each tab with 4 standard spaces before applying the multiplier.
The tool handles inputs up to 500,000 characters without issue. Beyond that threshold, browser memory allocation may cause lag. For very large files, split the text into chunks. Processing is synchronous and typically completes in under 10 milliseconds for inputs under 100,000 characters.
Yes. By setting a precise multiplier, you can expand column gaps in fixed-width text files (such as legacy mainframe reports or ASCII tables) uniformly. However, be aware that Word Gap mode multiplies all space runs equally. If your columns have varying gap widths, the proportional differences are maintained but all gaps grow by the same factor.