Question
Up and Down Triangle Characters in HTML: Unicode Symbols and Entities
Question
I want to display a triangle pointing up or down in HTML, similar to a toggle indicator.
I found the arrow characters below:
↑ <!-- ↑ -->
↓ <!-- ↓ -->
However, these include a vertical stem. I need symbols that look like only the arrowhead: a filled or unfilled triangle pointing up or down.
Which HTML or ASCII characters can be used for this?
Short Answer
By the end of this page, you will understand how HTML displays triangle symbols using Unicode characters, which up and down triangle characters are commonly used, how to include them in HTML with entities or numeric codes, and when to use text symbols versus CSS for toggle indicators.
Concept
HTML itself does not define a special “triangle” drawing system. When you place a symbol on a page, you are usually using a Unicode character that the browser renders with the current font.
That means when people ask for an “HTML character” such as an up or down triangle, the real answer is usually a Unicode symbol that can be inserted into HTML in one of these ways:
- directly as a character
- as a numeric character reference like
▲ - sometimes as a named HTML entity, if one exists
For triangle toggle indicators, the most common characters are:
▲up-pointing filled triangle▼down-pointing filled triangle△up-pointing hollow triangle▽down-pointing hollow triangle
These are often better than ↑ and ↓ when you want a compact visual indicator without a stem.
This matters in real programming because small UI indicators appear everywhere:
- expandable sections
- sort direction in tables
- dropdown toggles
- accordion headers
- navigation menus
A key detail: ASCII does not include triangle symbols. ASCII is a small older character set with basic Latin letters, digits, and punctuation. Triangles come from Unicode, not ASCII.
Mental Model
Think of HTML text like choosing characters from a giant symbol library.
- ASCII is a tiny drawer with simple characters like
A,1,?, and>. - Unicode is the full warehouse, containing arrows, triangles, currency symbols, emoji, and many writing systems.
So if you want a triangle-only arrowhead, you are not “drawing” one with HTML. You are picking the right symbol from the Unicode warehouse and placing it into your page.
Syntax and Examples
Common triangle characters
Here are some useful Unicode triangle symbols for HTML:
| Symbol | Meaning | Unicode | HTML numeric reference |
|---|---|---|---|
| ▲ | black up-pointing triangle | U+25B2 | ▲ |
| ▼ | black down-pointing triangle | U+25BC | ▼ |
| △ | white up-pointing triangle | U+25B3 | △ |
| ▽ | white down-pointing triangle | U+25BD | ▽ |
Using the character directly
Step by Step Execution
Consider this example:
<button id="toggleBtn">Menu ▼</button>
<script>
const button = document.getElementById("toggleBtn");
let open = false;
button.addEventListener("click", () => {
open = !open;
if (open) {
button.textContent = "Menu ▲";
} else {
button.textContent = "Menu ▼";
}
});
</script>
Step by step:
- The page first shows the button text as
Menu ▼. - JavaScript finds the button using
getElementById("toggleBtn"). - The variable
openstarts asfalse, meaning the menu is closed. - When the user clicks the button, the event listener runs.
open = !openflips the value:
Real World Use Cases
Triangle characters are commonly used as lightweight UI indicators.
Common examples
- Accordion sections:
FAQ ▼becomesFAQ ▲when opened - Dropdown menus: a button shows a down triangle before the menu opens
- Sortable table columns:
Price ▲for ascending,Price ▼for descending - Tree views: folders or nested items use triangles to show collapsed or expanded state
- Filter panels: sidebars often use a triangle to indicate whether a section is expanded
Why developers use text symbols
- quick to implement
- no image files needed
- works well in simple interfaces
- easy to update with JavaScript
- often good enough for internal tools and dashboards
For very polished UI, teams may instead use SVG icons or CSS-based shapes for more styling control.
Real Codebase Usage
In real projects, developers often use triangle characters in small reusable UI components.
Common patterns
1. State-based rendering
A component shows one symbol for closed and another for open:
const icon = isOpen ? "▲" : "▼";
2. Guarding against unclear meaning
A triangle alone may not be accessible or obvious, so developers often pair it with text:
<button>Show details ▼</button>
This is clearer than showing only ▼.
3. Conditional formatting in tables
Sorting UIs often switch symbols:
if (sortDirection === "asc") {
label = "Price ▲";
} else {
label = "Price ▼";
}
4. Fallback to CSS or SVG
If font rendering looks inconsistent, teams may replace Unicode triangles with:
- inline SVG icons
- icon libraries
- CSS borders that create triangles
5. Accessibility support
In production code, developers often add ARIA attributes:
Common Mistakes
1. Expecting ASCII to contain triangle symbols
ASCII does not include ▲ or ▼.
Broken assumption:
ASCII has a triangle character for this
Correct idea:
- use Unicode symbols
- insert them directly or with numeric references
2. Using arrow entities when you really want triangles
Broken choice:
↑ <!-- ↑ -->
↓ <!-- ↓ -->
These are arrows with stems, not triangle-only indicators.
Use triangles instead:
▲ <!-- ▲ -->
▼ <!-- ▼ -->
3. Assuming every symbol has a named entity
Not every Unicode character has a common named HTML entity.
Safer option:
▲
▼
Numeric references are broadly reliable.
4. Forgetting font differences
Comparisons
Triangles vs arrows
| Symbol type | Example | Best for | Limitation |
|---|---|---|---|
| Arrow with stem | ↑ ↓ | direction, movement | not ideal as compact toggle indicators |
| Triangle only | ▲ ▼ | toggles, expand/collapse, sort icons | appearance depends on font |
Direct character vs numeric reference
| Method | Example | Pros | Cons |
|---|---|---|---|
| Direct Unicode character | ▲ |
Cheat Sheet
Quick reference
Filled triangles
- Up:
▲→▲→ U+25B2 - Down:
▼→▼→ U+25BC
Hollow triangles
- Up:
△→△→ U+25B3 - Down:
▽→▽→ U+25BD
Example
<span>▲</span>
<span>▼</span>
<span>▲</span>
<span>▼</span>
Rules to remember
- ASCII does not include triangle symbols
- These symbols come from Unicode
- Numeric references work well in HTML
- Font choice can affect appearance
FAQ
What is the HTML character for an up triangle?
Use the Unicode character ▲ or the numeric HTML reference ▲.
What is the HTML character for a down triangle?
Use the Unicode character ▼ or the numeric HTML reference ▼.
Are triangle symbols part of ASCII?
No. Triangle symbols are part of Unicode, not ASCII.
Can I use named entities for these triangles?
Sometimes named entities exist for some symbols, but numeric references like ▲ and ▼ are the safer choice.
Why do my triangle symbols look different on another device?
Browsers render Unicode using available fonts, so the shape can vary slightly between systems.
Should I use Unicode triangles or CSS icons for a toggle?
Use Unicode triangles for simple text-based UI. Use CSS or SVG if you need precise styling and consistency.
Is ▲ better than ↑ for expand/collapse?
Usually yes. ▲ is more compact and looks like a toggle indicator, while ↑ suggests direction or movement.
Mini Project
Description
Build a simple expandable details section that uses Unicode triangle symbols in HTML. This project shows how triangle characters can communicate open and closed state without needing image files or icon libraries.
Goal
Create a button that toggles a content area and switches between ▼ and ▲ while keeping the interface clear and accessible.
Requirements
- Create a button that starts in the collapsed state.
- Display a down triangle when the content is hidden and an up triangle when it is visible.
- Show or hide a block of content when the button is clicked.
- Update the button text to match the current state.
- Include an
aria-expandedattribute on the button.
Keep learning
Related questions
Can You Style Half a Character in CSS? Text Effects with CSS and JavaScript
Learn how to style half of a character using CSS and JavaScript, including overlay techniques for dynamic text effects.
Check If a Checkbox Is Checked with jQuery
Learn how to check whether a checkbox is checked in jQuery using the correct selector, with examples, mistakes, and practical patterns.
Convert HTML and CSS to PDF in PHP: Options, Limits, and Practical Approaches
Learn how HTML-to-PDF conversion works in PHP, why CSS support varies, and how to choose a practical approach for Linux web servers.