Box-drawing character

From Wikipedia, the free encyclopedia
  (Redirected from )
Jump to: navigation, search
GNU Midnight Commander using box-drawing characters in the Win32 console

Box-drawing characters, also known as line-drawing characters, are a form of semigraphics widely used in text user interfaces to draw various geometric frames and boxes. In graphical user interfaces, these characters are much less useful as it is much simpler to draw lines and rectangles directly with graphical APIs. Box-drawing characters work only with monospaced fonts; however, they are still useful for plaintext comments on websites.

Used along with box-drawing characters are block elements, shade characters, and terminal graphic characters. These can be used for filling regions of the screen and portraying drop shadows.



Unicode includes 128 such characters.[1] In many Unicode fonts only the subset that is also available in the PC character set (see below) will exist, due to it being defined as part of the WGL4 character set.

Unicode box-drawing symbols. A rendering showing all 128 symbols (as they should appear in the chart at left)
Box Drawing[1]
Official Unicode Consortium code chart (PDF)
1.^ As of Unicode version 7.0




Their number is further limited to 22 on those code pages that replace the 18 "single/double hybrid" characters for other, usually alphabetic, characters (such as code page 850):


Note: The non-double characters are the "thin" ones (U+2500, U+2502), not the "wide" ones (U+2501, U+2503).

Unix, CP/M, BBS[edit]

On many Unix systems and early dial-up bulletin board systems the only common standard for box-drawing characters was the VT100 alternate character set. The escape sequence Esc ( 0 switched the codes for lower-case ASCII letters to draw this set, and the sequence Esc ( B switched back:


A Bash script that displays all of the semigraphic characters:

for i in ${char[*]}

On some terminals, these characters are not available at all, and the complexity of the escape sequences discouraged their use, so often only ASCII characters that approximate box-drawing characters are used, such as - (hyphen-minus), | (vertical bar), _ (underscore), = (equal sign) and + (plus sign) in a kind of ASCII art fashion.

Modern Unix terminal emulators use Unicode and thus have access to the line-drawing characters listed above.


Many microcomputers of the 1970s and 1980s had their own proprietary character sets, which also included box-drawing characters. Some of these sets, such as Commodore's PETSCII, include box-drawing symbols with no corresponding Unicode character.

ZX81 semigraphics


The BBC Micro could utilise the Teletext 7-bit character set, which had 128 box-drawing characters, whose code points were shared with the regular alphanumeric and punctuation characters. Control characters were used to switch between regular text and box drawing.[2]

Some recent embedded systems also use proprietary character sets, usually extensions to ISO 8859 character sets, which include box-drawing characters or other special symbols.

The World Standard Teletext (WST) uses pixel-drawing characters for some graphics. A character cell is divided in 2×3 regions, and 26 = 64 code positions are allocated for all possible combinations of "pixels". However, these characters are not included in the Unicode standard.


Sample diagrams made out of the standard box-drawing characters, using a monospaced font:

│ ││  ║ ║║  ║ ║║  │ ││
│  ╔═══╗ Some Text  │▒
│  ╚═╦═╝ in the box │▒
│ ├──┬──┤           │▒
│ └──┴──┘           │▒

See also[edit]