Hello World
Module Program
Sub Main()
Console.WriteLine("Hello, World!")
End Sub
End ModuleTap Run to execute
Program.vb · output appears here
Press Run to execute
Output streams here as your program runs.
Visual Basic .NET is an object-oriented programming language from Microsoft that runs on the .NET runtime. Evolving from the classic Visual Basic, it was relaunched for the .NET platform in 2002 and shares the Common Language Runtime and base class library with C#. It features an approachable, English-like syntax that makes it a popular choice for beginners and for line-of-business application development.
VB.NET is a managed, statically typed language compiled to intermediate language and executed by the .NET runtime, giving it access to the full .NET ecosystem and cross-platform support through modern .NET. It is commonly used for desktop applications, internal tooling, and enterprise software, and it interoperates fully with other .NET languages so libraries can be shared across projects.
Program.vb is the entry point for each run.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
Module Program
Sub Main()
Console.WriteLine("Hello, World!")
End Sub
End ModuleModule Program
Sub Main()
Dim name As String = Console.ReadLine()
Console.WriteLine("Hello, " & name & "!")
End Sub
End ModuleModule Program
Sub Main()
Dim nums() As Integer = {1, 2, 3, 4}
For Each n In nums
Console.WriteLine(n * n)
Next
End Sub
End ModuleModule Program
Function Add(a As Integer, b As Integer) As Integer
Return a + b
End Function
Sub Main()
Console.WriteLine(Add(2, 3))
End Sub
End ModuleImports System.Collections.Generic
Module Program
Sub Main()
Dim ages As New Dictionary(Of String, Integer) From {
{"alice", 30}, {"bob", 25}
}
ages("carol") = 28
For Each kv In ages
Console.WriteLine($"{kv.Key} is {kv.Value}")
Next
End Sub
End ModuleModule Program
Class Point
Public Property X As Integer
Public Property Y As Integer
Public Overrides Function ToString() As String
Return $"({X}, {Y})"
End Function
End Class
Sub Main()
Dim p As New Point With {.X = 3, .Y = 4}
Console.WriteLine(p)
End Sub
End ModuleImports System.Linq
Imports System.Collections.Generic
Module Program
Sub Main()
Dim nums As New List(Of Integer) From {1, 2, 3, 4, 5}
Dim evens = nums.Where(Function(n) n Mod 2 = 0)
For Each n In evens
Console.WriteLine(n)
Next
Console.WriteLine(nums.Sum())
End Sub
End ModuleModule Program
Sub Main()
Try
Dim x As Integer = 10
Dim y As Integer = 0
Console.WriteLine(x \ y)
Catch ex As DivideByZeroException
Console.WriteLine("Error: " & ex.Message)
Finally
Console.WriteLine("Done")
End Try
End Sub
End ModuleModule Program
Sub Main()
For Each n In {1, 5, 10}
Select Case n
Case 1
Console.WriteLine("one")
Case 2 To 9
Console.WriteLine("few")
Case Else
Console.WriteLine("many")
End Select
Next
End Sub
End ModuleModule Program
Sub Main()
Dim s As String = "Hello, World"
Console.WriteLine(s.ToUpper())
Console.WriteLine(s.Substring(0, 5))
Console.WriteLine(s.Replace("World", "VB"))
Console.WriteLine(s.Split(","c)(0).Trim())
End Sub
End ModuleThe editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Type or paste your code into the editor, then click Run (or press Ctrl/Cmd + Enter) to execute it.
Output streams into the console panel, including runtime errors, exit status, and execution time.
Nothing to install and no account to create — code runs in an isolated hosted runtime.
Language-aware autocomplete and IntelliSense suggestions where the editor has a matching language service
Syntax highlighting, with native compiler and runtime errors shown in the console
Bracket matching, auto-indentation, code folding, and a minimap
Multi-cursor editing plus find & replace (Ctrl/Cmd + F)
Full undo/redo history and copy to clipboard
Built on Monaco — the same editor that powers VS Code
Run on demand, or turn on Auto-run to execute on every change
Stop long-running or infinite programs at any time
A real console shows standard output, errors, exit status, and execution time
Pass standard input (stdin) to your program from the Input panel — one value per line
Switch between light and dark themes
Adjust font size and other editor settings
Toggle side-by-side or top/bottom layouts
Enter distraction-free fullscreen mode
Generate a shareable link to your exact code in one click — no login needed
Your work autosaves to your browser, so you can pick up where you left off
Copy the active file to your clipboard
Run code: Ctrl/Cmd + Enter
Find & replace: Ctrl/Cmd + F
Open the full shortcut list from the keyboard icon in the toolbar
Visual Basic .NET is one of 46 single-file compiler scratchpads. Each run submits only Program.vb; local sibling-file imports are not enabled.
Linked-project languages (23): Node.js, TypeScript, Deno, Python, C, Go, Dart, Swift, Rust, Ruby, PHP, Java, Kotlin, C++, C#, Nim, Crystal, Haxe, Zig, Scala, D, Bun, Objective-C.
Single-file scratchpads (46): Matplotlib, NumPy, pandas, Haskell, Clojure, Perl, Lua, Tcl, jq, Raku, Elixir, Bash, Zsh, Nushell, R, Assembly (NASM), Julia, Octave, Groovy, PowerShell, Visual Basic .NET, Odin, Pascal, Lisp, Erlang, CoffeeScript, COBOL, BASIC, V, Racket, OCaml, Prolog, AWK, Emacs Lisp, Emojicode, Forth, F#, Fortran, Assembly (NASM64), Solidity, Mojo, Ada, WASM (WAT), Gleam, Shell Script (sh), Scheme.
Download file exports the active Visual Basic .NET source file.