DevKits

ASCII 32

Space (SP)

Printable ASCII

Space character. The most common character in most texts. In URLs it must be percent-encoded (%20) or written as +.

Common uses & context

Decimal 32 (0x20) is Space, a whitespace code.Space character. The most common character in most texts. In URLs it must be percent-encoded (%20) or written as +.

Whitespace codes are printable in the sense that they occupy horizontal or vertical space, but they carry no ink. That makes SP a frequent source of hard-to-see bugs: trailing spaces that break string equality, mixed tabs and spaces that confuse indentation-sensitive languages, or the wrong newline convention (LF vs CRLF) between operating systems. Its binary byte is 00100000.

All encodings at a glance

Decimal32
Hexadecimal0x20
Octal0040
Binary00100000
HTML numeric entity 
URL encoding%20
UTF-8 bytes0x20

Code snippets

JavaScript

String.fromCharCode(32); // " "
32.toString(16); // "20"

Python

chr(32)           # ' '
ord(chr(32))      # 32
hex(32)           # '0x20'

HTML

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

Programming notes

  • Space (code 32) is invisible but significant — trailing or mixed whitespace silently breaks string equality and diffs.
  • Normalize line endings and trim whitespace explicitly rather than assuming input is clean.
  • Its byte value 32 (0x20) lets you match it precisely in a byte-level scan.

Frequently asked questions

What character is ASCII code 32?

ASCII code 32 is the character 'SP' (Space). In hexadecimal it is 0x20, in octal 0040, and in binary 00100000.

What is 0x20 in ASCII?

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

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

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

Nearby codes

Encode & convert this character