Non-breaking space#Narrow non-breaking space

{{Short description|Special character in text processing}}

{{redirect-distinguish|⍽|␣|⌴}}

{{Infobox punctuation mark|mark={{background color|#CEEEF2| }}|name=Non-breaking space|unicode={{unichar|00A0|NO-BREAK SPACE|html=}}|see_also={{unichar|202f|NARROW NO-BREAK SPACE|html=}}

{{unichar|0020|SPACE|nlink=Space (punctuation)}}{{efn|For presentation reasons, representations of a regular space in this article are replaced with a no-break space}}

Other types of spaces}}

In word processing and digital typesetting, a non-breaking space ({{char| }}), also called NBSP, required space,{{cite web |url=https://public.dhe.ibm.com/software/globalization/gcoc/attachments/CP01252.txt |title=Windows, Latin 1 |id=CPGID 01252 |work=REGISTRY, Graphic Character Sets and Code Pages |author=IBM |author-link=IBM |date=1998 |orig-year=1995}} 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.

Uses

Despite having layout and uses similar to those of whitespace, it differs in contextual behavior.{{Cite journal |doi = 10.3998/3336451.0013.105|title = Justify Just or Just Justify|journal = The Journal of Electronic Publishing|volume = 13|year = 2010|last1 = Elyaakoubi|first1 = Mohamed|last2 = Lazrek|first2 = Azzeddine|doi-access = free|hdl = 2027/spo.3336451.0013.105|hdl-access = free}}{{cite web |url=http://www.chicagomanualofstyle.org/qanda/data/faq/topics/SpecialCharacters.html |title=Special Characters |publisher=The Chicago Manual of Style Online}}

=Non-breaking behavior <span class="anchor" id="Nonbreaking behavior"></span>=

Text-processing software typically assumes that an automatic line break may be inserted anywhere a space character occurs; a non-breaking space prevents this from happening (provided the software recognizes the character).

For example, if the text "100 km" will not quite fit at the end of a line, the software may break the line between "100" and "km". Using a non-breaking space between "100" and "km" will prevent this behaviour. This guarantees that the text "100 km" will not be broken—if it does not fit at the end of a line, it is moved in its entirety to the next line. For this reason, many style guides recommend using a non-breaking space between numbers and their associated units.{{cite web |title=Style guide |url=https://ukma.org.uk/style-guide/ |publisher=UK Metric Association |access-date=21 April 2025 |date=12 July 2017 |quote=Where there is room, leave a (non-breaking) space between the number and the unit.}}{{cite web |title=Numbers, units and symbols |url=https://www.nice.org.uk/corporate/ecd1/chapter/numbers-units-and-symbols |publisher=National Institute for Health and Care Excellence |access-date=21 April 2025 |date=25 January 2016 |quote=Use non-breaking spaces between numbers and units (Ctrl+Shift+Space), except for percentages and temperatures (37°C, 76%).}}

In French typography, non-breaking spaces are used before "high punctuation" (:, ;, ?, and !), on the interior side of guillemets (« and »), and before footnotes. In the case of ;, ?, !, and footnotes (unless enclosed by parentheses), it is specifically the narrow non-breaking space that is used.{{cite book |title=Lexique des règles typographiques |date=1990 |publisher=Imprimerie nationale |isbn=2-11-081075-0 |pages=25, 148–149 |url=https://archive.org/details/lexique-des-regles-typographiques-en-usage-a-l-imprimerie-nationale/page/148/mode/2up |edition=3rd}}{{cite web |title=Types d’espacement |url=https://vitrinelinguistique.oqlf.gouv.qc.ca/24565/la-typographie/espacement/types-despacement |website=Office québécois de la langue française |publisher=Government of Quebec |access-date=21 April 2025 |language=fr-CA}}

In German typography, it is used between multi-part abbreviations (e.g., "z.{{nnbsp}}B.", "d.{{nnbsp}}h.", "v.{{nnbsp}}l.{{nnbsp}}n.{{nnbsp}}r.").{{cite web |url=http://www.verlagsherstellung.de/fileadmin/fbmedien_bmp/downloads/Abschlussarbeiten/Zweisprachige_Mikrotypografie_Amelie_Solbrig_VH-02.pdf#page=58 |title=Zweisprachige Mikrotypografie |last1=Solbrig |first1=Amelie |date=30 January 2008 |publisher=Hochschule für Technik, Wirtschaft und Kultur Leipzig |access-date=10 June 2018 |quote=Alle Abkürzungen mit Binnenpunkten werden im Deutschen mit einem gFL [geschütztes flexibles Leerzeichen] spationiert. [...] Die englische Schreibweise sieht keine Abstände zwischen einzelnen Buchstaben vor. Nach einem Binnenpunkt folgt demnach ohne gFL sofort der nächste Buchstabe. |language=de |archive-url=https://web.archive.org/web/20160311073646/http://www.verlagsherstellung.de/fileadmin/fbmedien_bmp/downloads/Abschlussarbeiten/Zweisprachige_Mikrotypografie_Amelie_Solbrig_VH-02.pdf#page=58 | archive-date=2016-03-11 |page=113 }}

=Non-collapsing behavior <span class="anchor" id="Noncollapsing behavior"></span>=

A second common application of non-breaking spaces is 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.{{Citation | chapter-url = http://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html#h-9.1 | publisher = W3 | date = 1999-12-24 | title = HTML 4.01 | chapter = Structure}}.{{Citation | chapter-url = http://www.w3.org/TR/CSS21/text.html#white-space-prop | publisher = W3 | title = CSS 2.1 | chapter = Text}}.

In contrast, non-breaking spaces are not merged with neighboring whitespace characters when displayed. They can, therefore, be used by an author to simply insert additional visible space in the resulting output without using spans styled with peculiar values of the CSS "white-space" property. Conversely, indiscriminate use (see the recommended use{{citation needed|date=November 2023}} in style guides), in addition to a normal space, gives extraneous space in the output.

Variations <span class="anchor" id="Width variation"></span>

= Narrow non-breaking space<span class="anchor" id="NNBSP"></span>=

{{unichar|202f|NARROW NO-BREAK SPACE|html=|note=NNBSP}} is another non-breaking space, but with a smaller width than the standard non-breaking space (U+00A0). When used with Mongolian, its width is usually one third of the normal space;{{cite web |title=Writing Systems and Punctuation |url=https://www.unicode.org/versions/Unicode7.0.0/ch06.pdf |work=The Unicode Standard 7.0 |publisher=Unicode Inc. |year=2014 |access-date=2014-11-02}} 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.{{citation needed|date=April 2025}}

It was introduced in Unicode 3.0 for Mongolian,{{cite web |title=AMENDMENT 29: Mongolian |url=https://www.unicode.org/L2/L1999/99381-fdam29.pdf |publisher=ISO/IEC |work=Information technology — Universal Multiple-Octet Coded Character Set (UCS) — Part 1: Architecture and Basic Multilingual Plane |year=1999 |id=ISO/IEC 10646-1:1993/FDAM 29:1999(E)}} to separate a suffix from the word stem without indicating a word boundary. It also triggers special shaping of those suffixes.{{cite book |title=The Unicode Standard Version 15.0 – Core Specification |date=September 2022 |chapter=6.2.3 Space Characters |publisher=The Unicode Consortium |isbn=978-1-936213-32-0 |url=https://www.unicode.org/versions/Unicode16.0.0/UnicodeStandard-16.0.pdf#page=268 |page=268}} Starting in Unicode 16.0, it is no longer recommended for this purpose, with the Mongolian vowel separator (U+180E) being recommended for this purpose instead.{{cite book |title=The Unicode Standard Version 16.0 – Core Specification |date=September 10, 2024 |chapter=6.2.3 Space Characters |publisher=The Unicode Consortium |isbn=978-1-936213-34-4 |url=https://www.unicode.org/versions/Unicode16.0.0/UnicodeStandard-16.0.pdf#page=327 |page=327}}{{cite book |title=The Unicode Standard Version 16.0 – Core Specification |date=September 10, 2024 |chapter=13.5.1 Mongolian: U+1800–U+18AF |publisher=The Unicode Consortium |isbn=978-1-936213-34-4 |url=https://www.unicode.org/versions/Unicode16.0.0/UnicodeStandard-16.0.pdf#page=651 |page=651 |quote=Prior to Unicode Version 16.0, U+202F NARROW NO-BREAK SPACE (NNBSP) was used to represent this small whitespace; it retains its Script_Extensions value of “Mong” to facilitate backward compatibility. However, its role has been taken over by U+180E MONGOLIAN VOWEL SEPARATOR (MVS), which not only prevents word breaking and line breaking, but also triggers special shaping for the following separated suffix.}}

In French typography, it is called {{lang|fr|espace fine insécable}} and is used before ;, ?, and !. Additionally, footnotes are preceded by a narrow non-breaking space (unless they are 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{{cite web |title=CLDR 34 Release Note |url=https://cldr.unicode.org/downloads/cldr-34#h.q1mr39yetx2z_l |publisher=The Unicode Consortium |date=2018-10-15 |quote=French grouping separator changed from no-break space U+00A0 to narrow no-break space U+202F.}}) and Venetian (starting in Unicode CLDR 44{{cite web |title=CLDR v44.0 — By-Type Chart: Numbers:Symbols |url=https://www.unicode.org/cldr/charts/44/by_type/numbers.symbols.html#a1ef41eaeb6982d |publisher=The Unicode Consortium |date=2023-10-25}}). In Spanish, the Royal Spanish Academy and Association of Academies of the Spanish Language's Diccionario panhispánico de dudas proscribes the use of a small space as the number group separator,{{Cite book |title=Diccionario panhispánico de dudas |url=https://www.rae.es/dpd/punto |access-date=2022-01-07 |publisher=Royal Spanish Academy and Association of Academies of the Spanish Language |language=es |chapter=punto |trans-chapter=Period |edition=2nd (provisional version) |quote=Para facilitar la lectura de los números cuya parte entera conste de más de cuatro cifras, se recomienda escribirlos separando con un pequeño espacio los grupos de tres dígitos, contados de derecha a izquierda}} although this is not the case in Unicode's Common Locale Data Repository (CLDR).{{cite web |title=CLDR v47.0 — By-Type Chart: Numbers:Symbols |url=https://unicode.org/cldr/charts/47/by_type/numbers.symbols.html#a1ef41eaeb6982d |publisher=The Unicode Consortium |date=2025-03-11}}

= Other variations =

Other non-breaking variants defined in Unicode.

;{{unichar|2007|FIGURE SPACE|nlink=Figure space|html=}}

:Produces a space equal to the figure (0–9) characters.

;{{unichar|2060|WORD JOINER|nlink=Word joiner|html=|note=WJ}}{{anchor|NoBreak}}

:Encoded in Unicode since version 3.2. The word joiner does not produce any space and prohibits a line break at its position.

Example

On browsers, resizing the window will demonstrate the effect of non-breaking spaces on the texts below.

To show the non-breaking effect of the non-breaking space, the following words have been separated with non-breaking spaces:

Lorem{{nbsp}}Ipsum{{nbsp}}Dolor{{nbsp}}Sit{{nbsp}}Amet{{nbsp}}Consectetur{{nbsp}}Adipiscing{{nbsp}}Elit{{nbsp}}Sed{{nbsp}}Do{{nbsp}}Eiusmod{{nbsp}}Tempor{{nbsp}}Incididunt{{nbsp}}Ut{{nbsp}}Labore{{nbsp}}Et{{nbsp}}Dolore{{nbsp}}Magna{{nbsp}}Aliqua{{nbsp}}Ut{{nbsp}}Enim{{nbsp}}Ad{{nbsp}}Minim{{nbsp}}Veniam{{nbsp}}Quis{{nbsp}}Nostrud{{nbsp}}Exercitation{{nbsp}}Ullamco{{nbsp}}Laboris{{nbsp}}Nisi{{nbsp}}Ut{{nbsp}}Aliquip{{nbsp}}Ex{{nbsp}}Ea{{nbsp}}Commodo{{nbsp}}Consequat{{nbsp}}Duis{{nbsp}}Aute

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:

Lorem{{nbsp}}Ipsum{{nbsp}}{{nbsp}}Dolor{{nbsp}}{{nbsp}}{{nbsp}}Sit{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Amet{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Consectetur{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Adipiscing{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Elit{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Sed{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Do{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Eiusmod{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Tempor{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Incididunt{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Ut{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp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}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Ad{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Minim

In contrast, the following words are separated with ordinary spaces:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Here, they are separated with narrow non-breaking spaces, to show the width of those:

Lorem{{nnbsp}}Ipsum{{nnbsp}}Dolor{{nnbsp}}Sit{{nnbsp}}Amet{{nnbsp}}Consectetur{{nnbsp}}Adipiscing{{nnbsp}}Elit{{nnbsp}}Sed{{nnbsp}}Do{{nnbsp}}Eiusmod{{nnbsp}}Tempor{{nnbsp}}Incididunt{{nnbsp}}Ut{{nnbsp}}Labore{{nnbsp}}Et{{nnbsp}}Dolore{{nnbsp}}Magna{{nnbsp}}Aliqua{{nnbsp}}Ut{{nnbsp}}Enim{{nnbsp}}Ad{{nnbsp}}Minim{{nnbsp}}Veniam{{nnbsp}}Quis{{nnbsp}}Nostrud{{nnbsp}}Exercitation{{nnbsp}}Ullamco{{nnbsp}}Laboris{{nnbsp}}Nisi{{nnbsp}}Ut{{nnbsp}}Aliquip{{nnbsp}}Ex{{nnbsp}}Ea{{nnbsp}}Commodo{{nnbsp}}Consequat{{nnbsp}}Duis{{nnbsp}}Aute

Unicode <span class="anchor" id="Encodings"></span>

  • {{unichar|00A0|nlink= |html=}}
  • {{unichar|2007|nlink= |html=}}
  • {{unichar|202F|nlink= |html=}}
  • {{unichar|2060|nlink= |html=}}

See also

  • Hyphens in computing, for information about hard and non-breaking hyphens
  • List of XML and HTML character entity references
  • {{annotated link|Hyphen#Nonbreaking hyphens|Non-breaking hyphen}}
  • {{annotated link|Punctuation}}
  • {{annotated link|Sentence spacing in digital media}}
  • {{annotated link|Space (punctuation)}}
  • {{Section link|Space (punctuation)|Non-breaking space}}, for applications
  • {{annotated link|Zero-width space}}, a non-spacing break
  • {{annotated link|Widows and orphans}}
  • {{annotated link|Non-printing character in word processors}}
  • {{Section link|Typographic alignment|Justified}}

Notes

{{Notelist}}

References