DevKits

ASCII 38

Ampersand (&)

Printable ASCII

Ampersand. Separates query string parameters. HTML entity: &. Bitwise AND in most languages.

Common uses & context

The character '&' — Ampersand — has ASCII code 38 (0x26), octal 0046, binary 00100110. Ampersand. Separates query string parameters. HTML entity: &. Bitwise AND in most languages.

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 %26), or in HTML (where it is written&). Knowing its exact code point (38) helps when you filter, validate, or sanitize input byte by byte.

All encodings at a glance

Decimal38
Hexadecimal0x26
Octal0046
Binary00100110
HTML numeric entity&
HTML named entity&
URL encoding%26
UTF-8 bytes0x26

Code snippets

JavaScript

String.fromCharCode(38); // "&"
38.toString(16); // "26"

Python

chr(38)           # '&'
ord(chr(38))      # 38
hex(38)           # '0x26'

HTML

&amp;   <!-- named entity -->
&#38;   <!-- numeric entity -->

Programming notes

  • Code 38 (0x26); URL-encoded form%26.
  • In HTML write it as &amp; (named) or &#38; (numeric) to avoid it being parsed as markup.
  • 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 38?

ASCII code 38 is the character '&' (Ampersand). In hexadecimal it is 0x26, in octal 0046, and in binary 00100110.

What is 0x26 in ASCII?

Hexadecimal 0x26 equals decimal 38, which is the character '&' (Ampersand). To convert hex to ASCII yourself, read the two hex digits as a base-16 number (0x26 = 38) and look up that code point.

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

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

Nearby codes

Encode & convert this character