Lably
Skip to content

Whitespace character

Computer text file character representing blank space

  • 9 min read
  • 4 chapters

Related on Lably

Through Character (computing), String (computer science) and Computer

For example, a space character (U+0020 SPACE, ASCII 32) represents blank space such as a word divider in a Western script.

A printable character results in output when rendered, but a whitespace character does not. Instead, whitespace characters define the layout of text to a limited degree, interrupting the normal sequence of rendering characters next to each other. The output of subsequent characters is typically shifted to the right (or to the left for right-to-left script) or to the start of the next line. The effect of multiple sequential whitespace characters is cumulative such that the next printable character is rendered at a location based on the accumulated effect of preceding whitespace characters.

The origin of the term whitespace is rooted in the common practice of rendering text on white paper. Normally, a whitespace character is not rendered as white. It affects rendering, but it is not itself rendered.

Overview

A space character typically inserts horizontal space that is about as wide as a letter. For a monospaced font the width is the width of a letter, and for a variable-width font the width is font-specific. Some fonts support multiple space characters that have different widths.

A tab character typically inserts horizontal space that is based on tab stops which vary by application.

A newline character sequence typically moves the render output location to the beginning of the next line. If one follows text, it does not actually result in whitespace. But, two sequential newline sequences between text blocks results in a blank line between the blocks. The height of the blank line varies by application.

Using whitespace characters to lay out text is a convention. Applications sometimes render whitespace characters as visible markup so that a user can see what is normally not visible.

Typically, a user types a space character by pressing spacebar, a tab character by pressing Tab ↹ and newline by pressing ↵ Enter.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication