Discord Text-Based Progress Bars
Render percentage bars in Discord messages using Unicode block characters inside a monospace code block. Works in any Discord client since it requires no special rendering.
Why / When to Use
When displaying progress, usage, or health metrics in a Discord bot message and you need a visual bar without image attachments. Pairs well with ANSI color labels.
Core Concept / Commands
Two key Unicode characters:
β(U+2588) β filled blockβ(U+2591) β light shade (empty)
Formula (10-block bar)
def make_bar(pct: int, width: int = 10) -> str:
filled = round(pct / 100 * width)
empty = width - filled
return "β" * filled + "β" * empty
# Usage
bar = make_bar(80) # β "ββββββββββ"Aligned multi-metric display
Wrap in a triple-backtick code block for monospace alignment:
CPU [ββββββββββ] 80%
RAM [ββββββββββ] 50%
DISK [ββββββββββ] 30%
Python to generate:
metrics = [("CPU", 80), ("RAM", 50), ("DISK", 30)]
lines = [f"{label:<5}[{make_bar(pct)}] {pct}%" for label, pct in metrics]
message = "```\n" + "\n".join(lines) + "\n```"Key Options / Variants
| Style | Example |
|---|---|
| Brackets | [ββββββββββ] 80% |
| Pipe | |ββββββββββ| 80% |
| Label + bar | CPU [ββββββββββ] 80% |
Gotchas
- Must use a triple-backtick code block to force monospace font; otherwise characters wonβt align.
round()can cause minor off-by-one for some percentages β acceptable for display purposes.- Emoji (π΄π‘π’) can be combined outside the bar for quick color-coded severity.
Source
Conversation: βText-based percentage bars for Discordβ β 2026-05-17
Updates β 2026-05-17
Self-contained build_bar variant (includes brackets + percentage label)
The build_bar function below returns the full formatted string including brackets and percentage β drop it directly into an f-string without extra formatting:
def build_bar(percentage: float, width: int = 10) -> str:
filled = round(percentage / 100 * width)
empty = width - filled
return f"[{'β' * filled}{'β' * empty}] {percentage:.0f}%"
# Usage in a Discord message line:
token_indicator = 'π΄' if token_pct >= 80 else 'π‘' if token_pct >= 50 else 'π’'
lines = [
f"**Token Usage:** {token_indicator} {build_bar(token_pct)} of {token_cap} tokens",
f"**Reset:** β° __***{format_reset(token_reset)}***__",
]Output: **Token Usage:** π‘ [ββββββββββ] 50% of 5000 tokens
Use build_bar when the bar and percentage belong together on one line. Use make_bar (core concept above) when you need the raw block string for custom placement.