{{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=}}<br /> {{unichar|0020|SPACE|nlink=Space (punctuation)}}{{efn|{{self-reference inline|For presentation reasons, the space characters are displayed with a pale blue background.}}}}
Other types of spaces}} In word processing and digital typesetting, a '''non-breaking space''' ({{char| }}), also called '''NBSP''', '''required space''',<ref>{{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}}</ref> '''hard space''', or '''fixed space''' (in most typefaces,{{efn|with the execption of Monospaced fonts}} 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 <span class="anchor" id="Nonbreaking behavior"></span>== Despite having layout and uses similar to those of whitespace, it differs in contextual behavior.<ref>{{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}}</ref><ref>{{cite web |url=http://www.chicagomanualofstyle.org/qanda/data/faq/topics/SpecialCharacters.html |title=Special Characters |publisher=The Chicago Manual of Style Online}}</ref>
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: <blockquote><div style="background:#f7f7f7; border:solid 1px #CCC; padding:4px;"> {{Not a typo|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}} </div></blockquote> By contrast, words separated with ordinary spaces will reflow as the window size changes: <blockquote><div style="background:#f7f7f7; border:solid 1px #CCC; padding:4px;"> {{Not a typo|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}} </div></blockquote> 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: <blockquote><div style="background:#f7f7f7; border:solid 1px #CCC; padding:4px;"> {{Not a typo|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}} </div></blockquote> ==Uses== ===Numbers with units=== Text-processing software can divide expressions like "100 km" when they do not quite fit at the end of a line. A non-breaking space between "100" and "km" prevents this, and guarantees that "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. Many style guides recommend that numbers and the associated units not be split across lines; non-breaking spaces are used to ensure this.<ref>{{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.}}</ref><ref>{{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%).}}</ref>
===Spacing punctuation in French=== In French typography, non-breaking spaces are used before "high punctuation" (<code>:</code>, <code>;</code>, <code>?</code>, and <code>!</code>), on the interior side of guillemets (<code>«</code> and <code>»</code>), and before footnote references. In the case of <code>;</code>, <code>?</code>, <code>!</code>, and footnote references (unless enclosed by parentheses), a ''narrow'' non-breaking space is used.<ref name="IN Group">{{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 |language=fr}}</ref><ref name="Quebec">{{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}}</ref>
===Multi-part abbreviations in German=== 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.''").<ref>{{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 }}</ref>
==Computer languages == ===Non-collapsing behavior <span class="anchor" id="Noncollapsing behavior"></span>=== 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.<ref>{{cite book |title=HTML 4.01 Specification |date=24 December 1999 |publisher=WC3 |url=https://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html#h-9.1 |chapter=Paragraphs, Lines, and Phrases}}</ref><ref>{{cite book |title=Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification |date=7 June 2011 |publisher=WC3 |url=https://www.w3.org/TR/CSS2/text.html#white-space-prop |chapter=16 Text}}</ref>
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: <blockquote><div style="background:#f7f7f7; border:solid 1px #CCC; padding:4px;"> {{Not a typo|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{{n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{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}magna{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}aliqua.{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}Ut{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}enim{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{nbsp}}{{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}} </div></blockquote> 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:
<blockquote><div style="background:#f7f7f7; border:solid 1px #CCC; padding:4px;"> {{Not a typo|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim}} </div></blockquote>
===Non-void or non-missing behavior <span class="anchor" id="Nonvoid behavior"></span>=== 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 <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=<code>NNBSP</code>}} 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;<ref>{{cite book |title=The Unicode Standard Version 10.0 – Core Specification |url=https://www.unicode.org/versions/Unicode10.0.0/ch06.pdf#page=12 |chapter=Writing Systems and Punctuation |publisher=Unicode Consortium |isbn=978-1-936213-16-0 |date=June 2017 |quote=In Mongolian text, the NNBSP is typically displayed with 1/3 the width of a normal space character. |page=269}}</ref> 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}}
This text replaces spaces with narrow non-breaking spaces: <blockquote><div style="background:#f7f7f7; border:solid 1px #CCC; padding:4px;"> {{Not a typo|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 }} </div></blockquote>
Narrow non-breaking space was introduced in 1999 in Unicode 3.0 for Mongolian,<ref>{{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)}}</ref> to separate a suffix from the word stem without indicating a word boundary. It also triggers special shaping of those suffixes.<ref name="Unicode Standard 15 - NNBSP">{{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/Unicode15.0.0/UnicodeStandard-15.0.pdf#page=294 |page=268}}</ref> 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.<ref name="Unicode Standard 16 - NNBSP">{{cite book |title=The Unicode Standard Version 16.0 – Core Specification |date=September 10, 2024 |chapter=6.2.3 Space Characters |publisher=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}}</ref><ref name="Unicode Standard 16 - Mongolian">{{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=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.}}</ref>
In French typography, it is called {{lang|fr|espace fine insécable}}<ref name="Unicode Standard 16 - NNBSP"/> and is used before <code>;</code>, <code>?</code>, and <code>!</code> (but not <code>:</code>, before which a regular non-breaking space is used).<ref name="IN Group"/><ref name="Quebec"/> Additionally, a footnote reference is preceded by a narrow non-breaking space<ref name="Quebec"/> (unless it is enclosed by parentheses, in which case a regular non-breaking space is used).<ref name="IN Group"/>
The narrow non-breaking space is used in numbers as a group separator in French (starting in Unicode CLDR 34<ref>{{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.}}</ref>) and Venetian (starting in Unicode CLDR 44<ref>{{cite web |work=CLDR v44.0 |title=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}}</ref>). 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,<ref>{{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}}</ref> although this is not the case in Unicode's Common Locale Data Repository (CLDR).<ref>{{cite web |work=CLDR v47.0 |title=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}}</ref>
===Figure space=== {{main|Figure space}} A figure space is a non-breaking space whose width is equal to the figure (0–9) characters.
==Unicode <span class="anchor" id="Encodings"></span>== Unicode has multiple non-breaking space characters: * {{unichar|00A0|html=}} * {{unichar|2007|nlink= |html=}} * {{unichar|202F|html=}} * {{unichar|FEFF|nlink=word joiner}} is a byte order mark, whose use in text is deemed an "unsupported character" in Unicode ({{unichar|2060|nlink=}} should be used if the need arises).<ref>{{cite web |last1=Freytag |first1=Asmus |title=FAQ - UTF-8, UTF-16, UTF-32 & BOM |at=What should I do with U+FEFF in the middle of a file? |url=https://www.unicode.org/faq/utf_bom#bom6 |website=Unicode |publisher=Unicode Consortium}}</ref>
== See also == * {{section link|Hyphen|Nonbreaking hyphens}} * {{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|Word joiner}}, prevents line-breaking without producing a space * {{annotated link|Widows and orphans}} * {{annotated link|Non-printing character in word processors}} * {{Section link|Typographic alignment|Justified}}
== Notes == {{Notelist}}
== References == {{Reflist}}
==External links== * {{cite web |title= Unicode® Standard Annex #14: Unicode line breaking algorithm |url=https://www.unicode.org/reports/tr14/ |editor-first=Robin |editor-last=Leroy |publisher=Unicode Consortium |date=2025-09-05 }}
{{DEFAULTSORT:Non-breaking space}} Category:Control characters Category:Whitespace Category:Unicode formatting code points