C# Console Methods

About This Index
This page is the C# Console Methods index. Each row links to a full guide with syntax, parameters, return value, three examples, and FAQs.
Learn what Console is for on /c-sharp/console. Use this page when you need a specific API such as WriteLine(), ReadLine(), or Clear().
Keyboard input usually arrives through standard input. Text you print with Write/WriteLine goes to standard output. Cursor and window helpers need a real console window and may throw when output is redirected.
How to Call a Console Method
All of these helpers are static on Console:
Console.Write("Name: ");
string? name = Console.ReadLine();
Console.WriteLine("Hi, " + name);
Console.Clear(); C# Console Methods Table
All method guides in this C# tutorial series (19 tutorials), grouped by purpose.
Writing
2 methodsPrint text to the console—with or without a trailing newline.
| Method | Description | Tutorial |
|---|---|---|
Write() | Print text to the console without adding a new line at the end. | Try it |
WriteLine() | Print text (or an empty line) and move to the next line. | Try it |
Reading
3 methodsRead characters, full lines, or a single key press from input.
Screen / cursor
8 methodsClear the screen, beep, reset colors, and manage cursor, buffer, and window.
| Method | Description | Tutorial |
|---|---|---|
Clear() | Clear the console screen buffer and reset the cursor to the home position. | Try it |
Beep() | Play a console beep; optional frequency and duration on supported platforms. | Try it |
ResetColor() | Restore foreground and background console colors to their defaults. | Try it |
GetCursorPosition() | Return the current cursor left/top as a tuple (.NET 5+). | Try it |
SetCursorPosition() | Move the console cursor to a column (left) and row (top). | Try it |
SetBufferSize() | Change the width and height of the console screen buffer. | Try it |
SetWindowSize() | Change the visible console window width and height. | Try it |
SetWindowPosition() | Move which part of the buffer is visible (window origin). | Try it |
Streams / redirect
6 methodsRedirect In/Out/Error, or open the raw standard streams as Stream objects.
| Method | Description | Tutorial |
|---|---|---|
SetIn() | Redirect Console standard input to a different TextReader. | Try it |
SetOut() | Redirect Console standard output to a different TextWriter. | Try it |
SetError() | Redirect Console standard error to a different TextWriter. | Try it |
OpenStandardInput() | Return the raw standard input Stream (optionally with a buffer size). | Try it |
OpenStandardOutput() | Return the raw standard output Stream (optionally buffered). | Try it |
OpenStandardError() | Return the raw standard error Stream (optionally buffered). | Try it |
Frequently Asked Questions
Start with WriteLine()
Print a line of text—the first Console method most beginners learn.
12 people found this page helpful
