ASCII 47
Solidus (Forward Slash) (/)
Printable ASCII
Forward slash. Path separator on Unix and in URLs. Division operator.
Common uses & context
The character '/' — Solidus (Forward Slash) — has ASCII code 47 (0x2F), octal 0057, binary 00101111. Forward slash. Path separator on Unix and in URLs. Division operator.
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 %2F), or in HTML. Knowing its exact code point (47) helps when you filter, validate, or sanitize input byte by byte.
All encodings at a glance
| Decimal | 47 |
| Hexadecimal | 0x2F |
| Octal | 0057 |
| Binary | 00101111 |
| HTML numeric entity | / |
| URL encoding | %2F |
| UTF-8 bytes | 0x2F |
Code snippets
JavaScript
String.fromCharCode(47); // "/"
47.toString(16); // "2f"Python
chr(47) # '/'
ord(chr(47)) # 47
hex(47) # '0x2f'HTML
/ <!-- numeric entity (no named entity for this character) -->Programming notes
- ▸Code 47 (0x2F); URL-encoded form%2F.
- ▸In HTML the numeric entity is /.
- ▸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 47?
ASCII code 47 is the character '/' (Solidus (Forward Slash)). In hexadecimal it is 0x2F, in octal 0057, and in binary 00101111.
What is 0x2F in ASCII?
Hexadecimal 0x2F equals decimal 47, which is the character '/' (Solidus (Forward Slash)). To convert hex to ASCII yourself, read the two hex digits as a base-16 number (0x2F = 47) and look up that code point.
How do I write the character with code 47 in code?
In JavaScript use String.fromCharCode(47); in Python use chr(47); in HTML use the numeric entity /. In a URL it is percent-encoded as %2F, and in UTF-8 it is stored as the byte sequence 0x2F.