Show line numbers on the left in the code editor

Page update date :
Page creation date :


While many published text editors show the line number of each line on the left, the Visual Studio code editor is not visible by default. This section describes how to display the line number of each line.


Operating Environment

Supported Visual Studio Versions

  • 2005
  • 2008
  • 2010

Check Visual Studio Version

  • 2005
  • 2008
  • 2010



The default setting in Visual Studio is that the line number is not displayed on each line in the Code Editor, as shown on the right. Some languages are displayed from the beginning, but many are not.

ツール - オプション

To display the line number, set it from the options.

Select Tools from the Visual Studio menu, and then choose Options.


When you open the Options dialog, expand Text Editors from the tree on the left and select All Languages and General. It is also possible to set it for each language, but you can set it at once by setting it from "All languages".

From the item displayed on the right, set "Line number" to the check state "☑", press the OK button to close.


The line number is now displayed on each line.