{{Short description|Special character in text processing}} {{Infobox_non-printing_character|mark=​|unicode={{unichar|U+200B|html=​}}}} {{distinguish|Zero width no-break space||}} The '''zero-width space''' (rendered: {{Not a typo|{{kbd|​}}}}; HTML entity: {{kbd|​}} or {{kbd|​}}), abbreviated '''ZWSP''', is a non-printing character used in computerized typesetting to indicate where the word boundaries are, without actually displaying a visible space in the rendered text. This enables text-processing systems for scripts that do not use explicit spacing to recognize where word boundaries are for the purpose of handling line breaks appropriately.

The zero-width space is Unicode character <code>U+200B</code>, and is located in the Unicode General Punctuation block. In HTML, it can be represented by the character entity reference {{As written|<code>&amp;ZeroWidthSpace;</code>}}.

== Purpose == The zero-width space marks a potential line break without hyphenation. Its semantics and HTML implementation are similar to the soft hyphen, but soft hyphens display a hyphen character at the point where the line is broken.

The zero-width space can be used to mark word breaks in languages without visible space between words, such as Thai, Myanmar, Khmer, and Japanese.<ref name="Unicode Standard">{{cite book |title=The Unicode Standard Version 15.0 – Core Specification |date=September 2022 |chapter=23.2 Layout Controls |publisher=The Unicode Consortium |isbn=978-1-936213-32-0 |url=https://www.unicode.org/versions/Unicode15.0.0/UnicodeStandard-15.0.pdf#page=944 |page=918}}</ref>

In justified text, the rendering engine may add inter-character spacing, also known as letter spacing, between letters separated by a zero-width space, unlike around fixed-width spaces.<ref name="Unicode Standard"/>

=== Example === To show the effect of the zero-width space in text, the following words have been separated with zero-width spaces: <blockquote><div style="background:#f7f7f7; border:solid 1px #CCC; padding:4px;"> {{Zwsp|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, the following words have not been separated: <blockquote><div style="background:#f7f7f7; border:solid 1px #CCC; padding:4px;"> {{Not a typo|LoremIpsumDolorSitAmetConsecteturAdipiscingElitSedDoEiusmodTemporIncididuntUtLaboreEtDoloreMagnaAliquaUtEnimAdMinimVeniamQuisNostrudExercitationUllamcoLaborisNisiUtAliquipExEaCommodoConsequatDuisAuteIrureDolorInReprehenderitInVoluptateVelitEsseCillumDoloreEuFugiatNullaPariaturExcepteurSintOccaecatCupidatatNonProidentSuntInCulpaQuiOfficiaDeseruntMollitAnimIdEstLaborum}} </div></blockquote>

The first text is broken into lines but only at word boundaries, and resizing the browser window will re-break the text accordingly, while the second text is not broken at all.

== Usage == === HTML === In HTML pages, the HTML element {{Tag|wbr|o}} functions as a zero-width space. In Internet Explorer 6, the zero-width space was not supported in some fonts.<ref>{{cite web|url=http://dunae.ca/2009/better-web-typography-with-spaces-and-hyphens/ |first=Alex|last=Dunae |title=Better Web Typography with Spaces and Hyphens |work=dunae.ca |access-date=December 3, 2009 |archive-url=https://web.archive.org/web/20101214223741/http://dunae.ca/2009/better-web-typography-with-spaces-and-hyphens/ |archive-date=December 14, 2010}}</ref>

=== Prohibition in domain names === ICANN rules prohibit domain names from containing non-displayed characters, including the zero-width space, and most browsers prohibit their use within domain names because they can be used to create a homograph attack, where a malicious URL is visually indistinguishable from a legitimate one.<ref>{{cite web |title=Network.IDN.blacklist_chars |work=mozillaZine |url=http://kb.mozillazine.org/Network.IDN.blacklist_chars |access-date=2018-02-07}}</ref><ref>{{cite web |title=Unicode Character 'Zero Width Space' |work=FileFormat.Info |url=https://www.fileformat.info/info/unicode/char/200b/index.htm |access-date=2018-02-07}}</ref>

== Encoding == {{Charmap|200b|name1=ZERO WIDTH SPACE}} The zero-width space character is encoded in Unicode as {{unichar|200B|ZERO WIDTH SPACE}}.<ref>{{cite web| title=General Punctuation – Unicode| url=https://www.unicode.org/charts/PDF/U2000.pdf| access-date=2013-07-20}}</ref>

In HTML, it can be referenced as {{Not a typo|<code>&amp;ZeroWidthSpace;</code>}}, {{Not a typo|<code>&amp;#8203;</code>}} or {{Not a typo|<code>&amp;#x200B;</code>}}. Additionally, the character entities <code>&amp;NegativeThickSpace;</code>, <code>&amp;NegativeMediumSpace;</code>, <code>&amp;NegativeThinSpace;</code>, and <code>&amp;NegativeVeryThinSpace;</code> all also refer to the zero-width space, contrary to what their names suggest.<ref>[https://zvon.org/comp/r/ref-MathML_2.html#Entities~ZeroWidthSpace Entities/ZeroWidthSpace] in MathML Version 2.0</ref>

The TeX representation is {{Not a typo|<code>\hskip0pt</code>}}; the LaTeX representation is <code>\hspace{0pt}</code>;<ref>{{cite web| title=The LaTeX Companion. Chapter 3: Basic Formatting Tools| url=https://www.latex-project.org/help/books/bookpart_tlc2-ch3.pdf| access-date=2019-07-16}}</ref> and the groff representation is <code>\:</code>.<ref>{{cite web| title=groff(7) – Linux manual page| url=http://man7.org/linux/man-pages/man7/groff.7.html| access-date=2014-02-08}}</ref>

== See also == * Hair space * Whitespace character – including a table comparing various space-like characters * Word divider * Word wrapping * Word joiner (U+2060) * U+FEFF (U+FEFF), which is named "Zero Width No-Break Space" in Unicode * Zero-width joiner (U+200D) * Zero-width non-joiner (U+200C)

== References == === Citations === {{reflist}}

=== Sources === {{refbegin}} * {{citation | first1 = Victor H. | last1 = Mair | authorlink1 = Victor H. Mair | first2 = Yongquan | last2 = Liu | title = Characters and computers | publisher = IOS Press | date = 1991 }} {{refend}}

{{-}} {{Unicode navigation}}

Category:Control characters Category:Typography Category:Unicode formatting code points Category:Whitespace <!--admittedly there is no space in a ZWS, but it's useful to put it in the category -->