Line and Box Drawing Characters
Unicode's Box Drawing block contains 128 characters for drawing lines, corners, intersections, and borders in monospaced text environments like terminals and CLI applications. This guide covers all box drawing characters with copy-paste support and examples of how to compose them into tables and borders.
Long before graphical user interfaces existed, programmers needed ways to draw borders, tables, and visual layouts in text-only terminals. The solution was a set of special characters that connect seamlessly when placed adjacent to each other, forming continuous lines, corners, and intersections. Unicode preserves this tradition in the Box Drawing block (U+2500-U+257F) and the Block Elements block (U+2580-U+259F), providing 128 box drawing characters and 32 block elements that remain essential for terminal applications, ASCII art, and monospaced text layouts.
History: From Code Page 437 to Unicode
Box drawing characters originated with IBM's Code Page 437, the default character set of the original IBM PC in 1981. Code Page 437 allocated positions 176-223 to a set of line-drawing and block characters that became iconic in DOS applications. Programs like Norton Commander, Turbo Pascal's IDE, and countless BBS interfaces used these characters to create window borders, menu frames, and table layouts.
When Unicode was created, these characters were preserved and expanded. The Box Drawing block at U+2500-U+257F contains exactly 128 characters — more than the original Code Page 437 set, covering single lines, double lines, and combinations of both in all possible connection configurations.
The Box Drawing Block (U+2500-U+257F)
The 128 box drawing characters are organized by line style and connection direction:
Line Styles
| Style | Horizontal | Vertical | Description |
|---|---|---|---|
| Light (single) | ─ (U+2500) | │ (U+2502) | Thin single lines |
| Heavy (bold) | ━ (U+2501) | ┃ (U+2503) | Thick single lines |
| Double | ═ (U+2550) | ║ (U+2551) | Parallel double lines |
| Dashed (light) | ┄ (U+2504) | ┆ (U+2506) | Triple-dash light lines |
| Dashed (heavy) | ┅ (U+2505) | ┇ (U+2507) | Triple-dash heavy lines |
| Double-dash (light) | ╌ (U+254C) | ╎ (U+254E) | Double-dash light |
| Double-dash (heavy) | ╍ (U+254D) | ╏ (U+254F) | Double-dash heavy |
Corner Characters
Corners connect a horizontal segment to a vertical segment at a 90-degree turn:
| Character | Code Point | Name | Connects |
|---|---|---|---|
| ┌ | U+250C | BOX DRAWINGS LIGHT DOWN AND RIGHT | Top-left corner |
| ┐ | U+2510 | BOX DRAWINGS LIGHT DOWN AND LEFT | Top-right corner |
| └ | U+2514 | BOX DRAWINGS LIGHT UP AND RIGHT | Bottom-left corner |
| ┘ | U+2518 | BOX DRAWINGS LIGHT UP AND LEFT | Bottom-right corner |
| ┏ | U+250F | BOX DRAWINGS HEAVY DOWN AND RIGHT | Heavy top-left |
| ┓ | U+2513 | BOX DRAWINGS HEAVY DOWN AND LEFT | Heavy top-right |
| ┗ | U+2517 | BOX DRAWINGS HEAVY UP AND RIGHT | Heavy bottom-left |
| ┛ | U+251B | BOX DRAWINGS HEAVY UP AND LEFT | Heavy bottom-right |
| ╔ | U+2554 | BOX DRAWINGS DOUBLE DOWN AND RIGHT | Double top-left |
| ╗ | U+2557 | BOX DRAWINGS DOUBLE DOWN AND LEFT | Double top-right |
| ╚ | U+255A | BOX DRAWINGS DOUBLE UP AND RIGHT | Double bottom-left |
| ╝ | U+255D | BOX DRAWINGS DOUBLE UP AND LEFT | Double bottom-right |
T-Junctions and Crosses
Where lines meet at T-junctions or four-way intersections:
| Character | Code Point | Name | Connects |
|---|---|---|---|
| ├ | U+251C | BOX DRAWINGS LIGHT VERTICAL AND RIGHT | Left T-junction |
| ┤ | U+2524 | BOX DRAWINGS LIGHT VERTICAL AND LEFT | Right T-junction |
| ┬ | U+252C | BOX DRAWINGS LIGHT DOWN AND HORIZONTAL | Top T-junction |
| ┴ | U+2534 | BOX DRAWINGS LIGHT UP AND HORIZONTAL | Bottom T-junction |
| ┼ | U+253C | BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL | Four-way cross |
| ╠ | U+2560 | BOX DRAWINGS DOUBLE VERTICAL AND RIGHT | Double left T |
| ╣ | U+2563 | BOX DRAWINGS DOUBLE VERTICAL AND LEFT | Double right T |
| ╦ | U+2556 | BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL | Double top T |
| ╩ | U+2569 | BOX DRAWINGS DOUBLE UP AND HORIZONTAL | Double bottom T |
| ╬ | U+256C | BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL | Double cross |
Drawing a Simple Box
To draw a box in a monospaced terminal, combine corners, horizontals, and verticals:
Single-line box:
┌────────────────┐
│ Hello, World! │
└────────────────┘
Double-line box:
╔════════════════╗
║ Hello, World! ║
╚════════════════╝
Heavy-line box:
┏━━━━━━━━━━━━━━━━┓
┃ Hello, World! ┃
┗━━━━━━━━━━━━━━━━┛
Drawing a Table
Tables use T-junctions and crosses to create cell boundaries:
┌──────┬──────┬──────┐
│ Name │ Age │ City │
├──────┼──────┼──────┤
│ Alice│ 30 │ NYC │
│ Bob │ 25 │ LA │
└──────┴──────┴──────┘
For double-line table headers with single-line body separators:
╔══════╦══════╦══════╗
║ Name ║ Age ║ City ║
╠══════╬══════╬══════╣
║ Alice║ 30 ║ NYC ║
║ Bob ║ 25 ║ LA ║
╚══════╩══════╩══════╝
Rounded Corners
Unicode also provides arc (rounded) corner characters for a softer appearance:
| Character | Code Point | Name |
|---|---|---|
| ╭ | U+256D | BOX DRAWINGS LIGHT ARC DOWN AND RIGHT |
| ╮ | U+256E | BOX DRAWINGS LIGHT ARC DOWN AND LEFT |
| ╯ | U+256F | BOX DRAWINGS LIGHT ARC UP AND LEFT |
| ╰ | U+2570 | BOX DRAWINGS LIGHT ARC UP AND RIGHT |
Rounded box:
╭────────────────╮
│ Hello, World! │
╰────────────────╯
Rounded corners are popular in modern CLI tools and TUI frameworks because they give a friendlier, less rigid appearance.
Block Elements (U+2580-U+259F)
Adjacent to the Box Drawing block, the Block Elements block provides solid and shaded rectangular fills:
| Character | Code Point | Name | Fill |
|---|---|---|---|
| ▀ | U+2580 | UPPER HALF BLOCK | Top half solid |
| ▄ | U+2584 | LOWER HALF BLOCK | Bottom half solid |
| █ | U+2588 | FULL BLOCK | Complete cell fill |
| ▌ | U+258C | LEFT HALF BLOCK | Left half solid |
| ▐ | U+2590 | RIGHT HALF BLOCK | Right half solid |
| ░ | U+2591 | LIGHT SHADE | 25% fill density |
| ▒ | U+2592 | MEDIUM SHADE | 50% fill density |
| ▓ | U+2593 | DARK SHADE | 75% fill density |
Block elements are used for progress bars, bar charts, pixel art, and background fills in terminal applications.
Generating Box Drawing in Python
Here is a Python function that draws a box around text:
def draw_box(text: str, style: str = "light") -> str:
styles = {
"light": ("┌", "┐", "└", "┘", "─", "│"),
"heavy": ("┏", "┓", "┗", "┛", "━", "┃"),
"double": ("╔", "╗", "╚", "╝", "═", "║"),
"round": ("╭", "╮", "╰", "╯", "─", "│"),
}
tl, tr, bl, br, h, v = styles[style]
lines = text.split("\n")
width = max(len(line) for line in lines)
top = f"{tl}{h * (width + 2)}{tr}"
bottom = f"{bl}{h * (width + 2)}{br}"
middle = [f"{v} {line:<{width}} {v}" for line in lines]
return "\n".join([top, *middle, bottom])
print(draw_box("Hello, World!", "round"))
# ╭───────────────╮
# │ Hello, World! │
# ╰───────────────╯
Modern TUI Frameworks
Modern terminal UI frameworks heavily use box drawing characters:
| Framework | Language | Box Drawing Usage |
|---|---|---|
| Rich | Python | Tables, panels, progress bars, tree views |
| Textual | Python | Full widget borders, scrollable panels |
| Bubble Tea | Go | TUI components with customizable borders |
| Ratatui | Rust | Dashboard layouts, charts, tables |
| blessed / neo-blessed | Node.js | Full-screen terminal UIs |
These frameworks abstract away individual character selection, but understanding the underlying characters helps when debugging rendering issues or creating custom border styles.
Compatibility Considerations
Box drawing characters require a monospaced font to align properly. In proportional fonts, the line segments will not connect because characters have different widths. Key compatibility notes:
- Terminal emulators: Full support in all modern terminals (iTerm2, Windows Terminal, GNOME Terminal, Alacritty, kitty)
- Web browsers: Supported when using monospace CSS font-family
- Mobile: Generally supported, but touch keyboards do not include these characters
- Email clients: Rendering depends on the client's font; avoid in HTML emails
- CJK fullwidth: Box drawing characters are halfwidth; they may not align correctly with fullwidth CJK characters without careful spacing
Summary
The Box Drawing and Block Elements blocks are Unicode's gift to terminal programmers. Their 160 characters provide everything needed to draw borders, tables, trees, and progress bars in monospaced text environments. From the original IBM PC to modern Rust TUI frameworks, these characters remain indispensable tools for creating structured visual layouts without graphics.
Mais em Symbol Reference
Unicode contains hundreds of arrow symbols spanning simple directional arrows, double arrows, …
Unicode provides multiple check mark and tick symbols ranging from the classic …
Unicode includes a rich collection of star shapes — from the simple …
Unicode contains dozens of heart symbols including the classic ♥, black and …
Unicode's Currency Symbols block and surrounding areas contain dedicated characters for over …
Unicode has dedicated blocks for mathematical operators, arrows, letterlike symbols, and alphanumeric …
Beyond the ASCII parentheses and square brackets, Unicode includes angle brackets, curly …
Unicode offers a wide variety of bullet point characters beyond the standard …
Unicode includes musical note symbols such as ♩♪♫♬ in the Miscellaneous Symbols …
Unicode includes precomposed fraction characters for common fractions like ½ ¼ ¾ …
Unicode provides precomposed superscript and subscript digits and letters — such as …
Unicode contains dozens of circle symbols including filled circles, outlined circles, circles …
Unicode includes filled squares, outlined squares, small squares, medium squares, dashed squares, …
Unicode provides a comprehensive set of triangle symbols in all orientations — …
Unicode includes filled and outline diamond shapes, lozenge characters, and playing card …
Unicode provides various cross and X mark characters including the heavy ballot …
The hyphen-minus on your keyboard is just one of Unicode's many dash …
Unicode defines typographic quotation marks — curly quotes — for dozens of …
Unicode includes dedicated characters for the copyright symbol ©, registered trademark ®, …
The degree symbol ° (U+00B0) and dedicated Celsius ℃ and Fahrenheit ℉ …
Unicode's Enclosed Alphanumerics block provides circled numbers ①②③, parenthesized numbers ⑴⑵⑶, and …
Unicode includes a Number Forms block with precomposed Roman numeral characters such …
Greek letters like α β γ δ π Σ Ω are widely …
The Unicode Dingbats block (U+2700–U+27BF) contains 192 decorative symbols originally from the …
Unicode includes a Playing Cards block with characters for all 52 standard …
Unicode provides characters for all six chess piece types in both white …
Unicode's Miscellaneous Symbols block includes the 12 zodiac signs ♈♉♊♋♌♍♎♏♐♑♒♓, planetary symbols, …
Unicode's Braille Patterns block (U+2800–U+28FF) encodes all 256 possible combinations of the …
Unicode's Geometric Shapes block contains 96 characters covering circles, squares, triangles, diamonds, …
The Unicode Letterlike Symbols block contains mathematical and technical symbols derived from …
Unicode's Miscellaneous Technical block contains symbols from computing, electronics, and engineering, including …
Diacritics are accent marks and other marks that attach to letters to …
Unicode defines dozens of invisible characters beyond the ordinary space, including zero-width …
Unicode includes warning and hazard symbols such as the universal caution ⚠ …
Unicode's Miscellaneous Symbols block includes sun ☀, cloud ☁, rain ☂, snow …
Unicode includes symbols for many of the world's major religions including the …
Unicode includes the traditional male ♂ and female ♀ symbols from astronomy, …
Apple's macOS uses Unicode characters for keyboard modifier keys such as ⌘ …
Unicode symbols like ▶ ◀ ► ★ ✦ ⚡ ✈ and hundreds …