This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Visual Studio
VS 2003+

Visual Studio Visible White Space

In some programming and scripting languages, configuration files and markup languages, white space can be significant. To ensure that a file contains the correct use of tabs and spaces, you can make these characters visible in Visual Studio.

Visible White Space

When working with a programming or markup language that uses significant white space, the incorrect use of spaces and tabs may alter the behaviour of a program. To ensure that you have not accidentally used tabs instead of spaces or added trailing white space to lines of code, you can make the white space characters visible in Visual Studio. When visible, spaces are shown as a small dot and tab characters as an arrow.

Visible white space can also be useful where white space is insignificant but affects the formatting of the text in the editor. It is good practice to indent blocks of code to show the logical structure of a program. However, if the indentation uses a mixture of spaces and tabs, the code may appear differently when viewed with a different default tab size. Consistently using either spaces or tabs removes this problem.

To make white space visible, open the Edit menu and the Advanced sub-menu. Select "View White Space" to toggle the setting. The result should be similar to that shown below.

Visual Studio Visible White Space

2 March 2010