DevKits

ASCII 166

Broken Bar (¦)

Latin-1 Supplement

Latin-1 character.

Common uses & context

Decimal 166 (0xA6) is Broken Bar, part of the Latin-1 Supplement (128–255). Latin-1 character. It renders as '¦' and its binary byte is 10100110.

This is where single-byte ASCII ends and encoding matters. In Latin-1 (ISO-8859-1) '¦' is the single byte 0xA6. In UTF-8 — today's default for the web — the same character is the multi-byte sequence 0xC2 0xA6. Treating a Latin-1 byte as UTF-8 (or vice versa) is the usual reason accented letters and symbols turn into mojibake like é or €. The Unicode code point is U+00A6, and in HTML you can write it as ¦ or ¦.

All encodings at a glance

Decimal166
Hexadecimal0xA6
Octal0246
Binary10100110
HTML numeric entity¦
HTML named entity¦
URL encoding%A6
UTF-8 bytes0xC2 0xA6

Code snippets

JavaScript

String.fromCharCode(166); // "¦"
166.toString(16); // "a6"

Python

chr(166)           # control char ¦
ord(chr(166))      # 166
hex(166)           # '0xa6'

HTML

&brvbar;   <!-- named entity -->
&#166;   <!-- numeric entity -->

Programming notes

  • Single byte 0xA6 in Latin-1, but the multi-byte sequence 0xC2 0xA6 in UTF-8 — never assume one byte per character above code 127.
  • Unicode code point U+00A6; HTML entity &brvbar;.
  • If '¦' shows as mojibake, the encoding declared and the encoding used disagree — align both on UTF-8.

Unicode & UTF-8 note

In Unicode this is U+00A6. In UTF-8 it encodes to the byte sequence 0xC2 0xA6. In legacy Latin-1 (ISO-8859-1) it is a single byte 0xA6, which is why Latin-1 files often appear as mojibake when interpreted as UTF-8.

Frequently asked questions

What character is ASCII code 166?

ASCII code 166 is the character '¦' (Broken Bar). In hexadecimal it is 0xA6, in octal 0246, and in binary 10100110.

What is 0xA6 in ASCII?

Hexadecimal 0xA6 equals decimal 166, which is the character '¦' (Broken Bar). To convert hex to ASCII yourself, read the two hex digits as a base-16 number (0xA6 = 166) and look up that code point.

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

In JavaScript use String.fromCharCode(166); in Python use chr(166); in HTML use the numeric entity &#166; or the named entity &brvbar;. In a URL it is percent-encoded as %A6, and in UTF-8 it is stored as the byte sequence 0xC2 0xA6.

Is '¦' part of standard ASCII?

No. Standard ASCII covers codes 0–127 only. '¦' is code 166, part of the Latin-1 Supplement (128–255, sometimes called "extended ASCII"). It is a single byte 0xA6 in Latin-1 but a multi-byte sequence (0xC2 0xA6) in UTF-8.

Nearby codes

Encode & convert this character