Non-breaking space
≈ 5 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
In word processing and digital typesetting, a non-breaking space ( ), also called NBSP, required space, hard space, or fixed space (in most typefaces, it is not of fixed width), is a space character that prevents an automatic line break at its position. In some formats, including HTML, it also prevents consecutive whitespace characters from collapsing into a single space. Non-breaking space characters with other widths also exist.
In word processing and digital typesetting, a non-breaking space ( ), also called NBSP, required space, hard space, or fixed space (in most typefaces, it is not of fixed width), is a space character that prevents an automatic line break at its position. In some formats, including HTML, it also prevents consecutive whitespace characters from collapsing into a single space. Non-breaking space characters with other widths also exist.
Behavior
Despite having layout and uses similar to those of the standard space character, it differs in contextual behavior. Text-processing software generally assumes that an automatic line break may be inserted anywhere a space character occurs; a non-breaking space prevents this from happening, if it is supported by the software. To show the effect of the non-breaking space in text, the following words have been separated with non-breaking spaces. No matter the width of the window, no line breaks are displayed: By contrast, words separated with ordinary spaces will reflow as the window size changes: In this example, most spaces are non-breaking, but every third space is an ordinary breaking space. This shows how groups of words can be prevented from being divided across lines by automatic line breaks:
Non-collapsing behavior
Non-breaking spaces are used in plain text file formats such as SGML, HTML, TeX, and LaTeX, whose rendering engines are programmed to treat sequences of whitespace characters (space, newline, tab, form feed, etc.) as if they were a single character (but this behavior can be overridden). Such "collapsing" of whitespace allows the author to neatly arrange the source text using line breaks, indentation and other forms of spacing without affecting the final typeset result. To show the non-collapsing behavior of the non-breaking space, the following words have been separated with an increasing number of non-breaking spaces: In contrast, the first few words of this phrase have been separated with many ordinary spaces but are displayed (rendered by the browser engine) as single spaces:
Non-void or non-missing behavior
In programming languages or in software analysis languages (such as SAS or R) non-breaking spaces can be useful to fill character-type variables with spaces that are not to be considered insignificant. In general, a string filled with spaces can be interpreted as an empty string or a string of missing data. Replacing ordinary spaces with non-breaking spaces helps resolving the ambiguity between "space", "void", and "missing".
Variations
Narrow non-breaking space
is a non-breaking space that is narrower than the standard non-breaking space (U+00A0). For Mongolian, it is usually one third the width of a normal space; in other contexts, its width is about 70% of the normal space, but may resemble that of the thin space (U+2009), at least with some fonts. This text replaces spaces with narrow non-breaking spaces: Narrow non-breaking space was introduced in 1999 in Unicode 3.0 for Mongolian, to separate a suffix from the word stem without indicating a word boundary. It also triggers special shaping of those suffixes.
Starting in Unicode 16.0, it is no longer recommended for this purpose because the Mongolian vowel separator (U+180E) has taken on this function. In French typography, it is called and is used before ; , ? , and ! (but not : , before which a regular non-breaking space is used). Additionally, a footnote reference is preceded by a narrow non-breaking space (unless it is enclosed by parentheses, in which case a regular non-breaking space is used).
The narrow non-breaking space is used in numbers as a group separator in French (starting in Unicode CLDR 34 ) and Venetian (starting in Unicode CLDR 44 ). In Spanish, the Royal Spanish Academy and Association of Academies of the Spanish Language's Diccionario panhispánico de dudas prescribes a small space as the number group separator, although this is not the case in Unicode's Common Locale Data Repository (CLDR).
Unicode
Unicode has multiple non-breaking space characters. Another international standard, ISO/IEC 9995-7 (Symbols used to represent functions), defines symbols that can be used on keyboards and in keyboard documentation for some of these characters. These symbols are also contained in ISO 7000 (Graphical symbols for use on equipment – Registered symbols) or IEC 60417 (Graphical symbols for use on equipment). is a byte order mark, whose use in text is deemed an "unsupported character" in Unicode ( should be used if the need arises).
Text derived from https://en.wikipedia.org/w/index.php?oldid=1374341067 under CC BY-SA 4.0; modifications have been made.