title | description | ms.date | ms.topic | helpviewer_keywords | ms.custom | author | ms.author | manager | ms.subservice | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Display line numbers for code |
Turn line numbering for your code on and off in the Visual Studio code editor. Line numbers can be useful as a reference. |
09/19/2024 |
how-to |
|
ide-ref |
anandmeg |
meghaanand |
mijacobs |
general-ide |
This article describes how to show or hide line numbers in your code.
-
On the Visual Studio menu bar, select Tools > Options > Text Editor, and then select either the language you're using or All Languages. All Languages turns line numbers on or off in all supported programming languages.
You can also type line number in the Visual Studio Search box, and then select Turn line numbers on or off in the results.
:::image type="content" source="media/line-numbers-search-box.png" alt-text="Screenshot of using the Search box to search for line numbers.":::
-
Select the Line numbers checkbox to show line numbers, or clear the checkbox to hide line numbers.
:::image type="content" source="../../ide/reference/media/line-numbers-option.png" alt-text="Screenshot of the Options dialog that you can use to show or hide line numbers in the Visual Studio editor." lightbox="../../ide/reference/media/line-numbers-option.png":::
Note
Line numbers aren't added to your code. They're just for reference.