HTML Entity for Vertical Bar (|)

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 1 Code Example
Unicode U+007C

What You'll Learn

How to display the Vertical Bar symbol (|) in HTML using various entity methods. Also known as the pipe symbol, this character is U+007C (VERTICAL LINE) in the Basic Latin block—essential for code examples, logic expressions, separators, and technical documentation.

Render it with |, |, the named entity |, or CSS escape \7C. In UTF-8 you can also type | directly in source files.

⚡ Quick Reference — Vertical Bar Entity

Unicode U+007C

Basic Latin (ASCII)

Hex Code |

Hexadecimal reference

HTML Code |

Decimal reference

Named Entity |

Most readable option

Reference Table
Name           Value
────────────   ──────────
Unicode        U+007C
Hex code       |
HTML code      |
Named entity   |
CSS code       \7C
Also called    Pipe symbol, vertical line
Block          Basic Latin (U+0000–U+007F)
1

Complete HTML Example

A simple example showing the Vertical Bar (|) using hexadecimal code, decimal HTML code, named entity, and a CSS content escape:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\7C";
  }
 </style>
</head>
<body>
<p>Symbol (hex): &#x7C;</p>
<p>Symbol (decimal): &#124;</p>
<p>Symbol (named): &vert;</p>
<p id="point">Symbol (CSS): </p>
</body>
</html>
Try It Yourself

🌐 Browser Support

The Vertical Bar (|) is universally supported in all modern browsers:

Chrome1+
Firefox1+
Safari1+
Edge12+
Opera4+
Android4.4+
iOS Safari1+

👀 Live Preview

See the Vertical Bar rendered live in different contexts:

Inline textHome | About | Contact
Large glyph|
Shell pipelinecat file.txt | grep error
Logic ORa || b → a | b (in some notations)
Numeric refs&#x7C; &#124; &vert; \7C

🧠 How It Works

1

Hexadecimal Code

&#x7C; uses the Unicode hexadecimal value 7C to display the Vertical Bar. The x prefix indicates hexadecimal format.

HTML markup
2

Decimal HTML Code

&#124; uses the decimal Unicode value 124 to display the same character. One of the most commonly used methods.

HTML markup
3

CSS Entity

\7C is used in CSS stylesheets, particularly in the content property of pseudo-elements like ::before and ::after.

CSS stylesheet
4

Named Entity

&vert; is the semantic named entity — the easiest to read in source HTML for the pipe / vertical bar character.

HTML markup
=

Same visual result

All four methods produce the glyph: |. Unicode U+007C sits in Basic Latin (ASCII). Do not confuse with broken bar U+00A6 (¦, &brvbar;).

Use Cases

The Vertical Bar (|) is commonly used in:

💻 Code examples

Programming tutorials, API docs, and technical articles showing pipe syntax.

📐 Logic expressions

Boolean OR notation, truth tables, and mathematical logic content.

📋 Separators

Navigation breadcrumbs, menu dividers, and inline content separators.

🖥 Command-line docs

Unix/Linux shell pipelines and system administration guides (e.g. cmd1 | cmd2).

🔍 Regular expressions

Regex patterns where | denotes alternation between sub-patterns.

📄 Technical writing

Documentation referencing the pipe character in prose or formatted examples.

🌐 Web UI

Filters, tags, and interface copy using the vertical bar as a visual divider.

💡 Best Practices

Do

  • Use &vert; for readable source markup
  • Wrap code snippets in <code> or <pre> elements
  • Pick one style (hex / decimal / named) per project
  • Add spacing around | when used as a UI separator
  • Distinguish | from broken bar ¦ (&brvbar;)

Don’t

  • Confuse | (U+007C) with ¦ broken bar (&brvbar;)
  • Mix entity styles randomly in one file
  • Use CSS escape \7C inside HTML markup
  • Use HTML entities inside JS strings (use \u007C or '|')
  • Overuse | as a separator without adequate spacing

Key Takeaways

1

Three HTML references all render |

&#x7C; &#124; &vert;
2

For CSS stylesheets, use the escape in the content property

\7C
3

Unicode U+007C — VERTICAL LINE (pipe symbol)

4

Prefer &vert; for readability in HTML source

5

Previous: Versicle (℣)   Next: Vertical Ellipsis

❓ Frequently Asked Questions

Use &#x7C; (hex), &#124; (decimal), &vert; (named), or \7C in CSS content. All produce |. In UTF-8 you can also type | directly.
U+007C (VERTICAL LINE). Basic Latin block. Hex 7C, decimal 124. Also called the pipe symbol in programming contexts.
In code examples, logic expressions, separators, command-line pipelines, regular expressions, and technical documentation that references the pipe character.
HTML entities (&#124;, &#x7C;, or &vert;) go directly in markup. The CSS escape \7C is used in stylesheets, typically in the content property of ::before or ::after. Same visual result, different layers of the stack.
Yes. &vert; is the named HTML entity for | (U+007C). &#124; and &#x7C; are equivalent in modern browsers.

Explore More HTML Entities!

Discover 1500+ HTML character references — punctuation, symbols, math operators, and more.

All HTML Entities →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful