DevKits

ASCII 124

Vertical Line (|)

Printable ASCII

Vertical bar / pipe. Bitwise OR, regex alternation, shell pipe, TypeScript union types.

Common uses & context

The character '|' — Vertical Line — has ASCII code 124 (0x7C), octal 0174, binary 01111100. Vertical bar / pipe. Bitwise OR, regex alternation, shell pipe, TypeScript union types.

Punctuation and symbol codes carry the most syntactic weight per byte in programming: a single '|' can change how a parser reads an entire expression. When '|' needs to appear as literal data rather than syntax, you often have to escape it — in string literals, in regular expressions, in URLs (where it becomes %7C), or in HTML. Knowing its exact code point (124) helps when you filter, validate, or sanitize input byte by byte.

All encodings at a glance

Decimal124
Hexadecimal0x7C
Octal0174
Binary01111100
HTML numeric entity|
URL encoding%7C
UTF-8 bytes0x7C

Code snippets

JavaScript

String.fromCharCode(124); // "|"
124.toString(16); // "7c"

Python

chr(124)           # '|'
ord(chr(124))      # 124
hex(124)           # '0x7c'

HTML

&#124;   <!-- numeric entity (no named entity for this character) -->

Programming notes

  • Code 124 (0x7C); URL-encoded form%7C.
  • In HTML the numeric entity is &#124;.
  • When used as literal data in regex or strings, '|' usually needs escaping — check the rules for your language.

Frequently asked questions

What character is ASCII code 124?

ASCII code 124 is the character '|' (Vertical Line). In hexadecimal it is 0x7C, in octal 0174, and in binary 01111100.

What is 0x7C in ASCII?

Hexadecimal 0x7C equals decimal 124, which is the character '|' (Vertical Line). To convert hex to ASCII yourself, read the two hex digits as a base-16 number (0x7C = 124) and look up that code point.

How do I write the character with code 124 in code?

In JavaScript use String.fromCharCode(124); in Python use chr(124); in HTML use the numeric entity &#124;. In a URL it is percent-encoded as %7C, and in UTF-8 it is stored as the byte sequence 0x7C.

Nearby codes

Encode & convert this character