Hello, World!
void main() {
print('Hello, World!');
}Tap Run to execute
main.dart · output appears here
Press Run to execute
Output streams here as your program runs.
Dart is a client-optimized, object-oriented programming language developed by Google and first released in 2011. It is statically typed with sound null safety, compiles to native machine code or JavaScript, and offers a clean, familiar C-style syntax along with features like async/await and a rich standard library.
Dart is best known as the language behind Flutter, Google's UI toolkit for building cross-platform mobile, web, and desktop apps from a single codebase. It is also used for command-line tools and server-side applications. Its fast compilation and hot reload make it a productive choice for modern app development.
main.dart is the entry point. Add helper files from the explorer and import them into your project.
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.
main.dart imports the sibling Dart library by filename.
import 'helper.dart';
void main() {
print(answer());
}
int answer() => 42;
void main() {
print('Hello, World!');
}import 'dart:io';
void main() {
stdout.write('Enter your name: ');
String? name = stdin.readLineSync();
print('Hello, $name!');
}void main() {
var fruits = ['apple', 'banana', 'cherry'];
for (var i = 0; i < fruits.length; i++) {
print('${i + 1}: ${fruits[i]}');
}
}int factorial(int n) => n <= 1 ? 1 : n * factorial(n - 1);
void main() {
print(factorial(5));
}void main() {
try {
int n = int.parse('abc');
print(n);
} on FormatException catch (e) {
print('Invalid number: ${e.message}');
} finally {
print('Done');
}
}void main() {
var counts = <String, int>{};
for (var ch in 'banana'.split('')) {
counts[ch] = (counts[ch] ?? 0) + 1;
}
counts.forEach((ch, n) => print('$ch: $n'));
}void main() {
var nums = [3, 1, 4, 1, 5];
nums.sort();
var doubled = nums.map((n) => n * 2).toList();
print(doubled);
print('Sum: ${nums.reduce((a, b) => a + b)}');
}class Person {
final String name;
final int age;
Person(this.name, this.age);
String describe() => '$name ($age)';
}
void main() {
var p = Person('Ada', 36);
print(p.describe());
}Future<String> fetch() async {
await Future.delayed(Duration(milliseconds: 10));
return 'data';
}
void main() async {
var result = await fetch();
print(result);
}String greet(String name, {String greeting = 'Hi'}) {
return '$greeting, $name';
}
void main() {
print(greet('Ada'));
print(greet('Bob', greeting: 'Hello'));
}The 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
Dart is one of 23 linked-project compilers. Run always starts main.dart; selecting a helper tab changes what you edit, not the entry file.
main.dart imports the sibling Dart library by filename.
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. Their extra project files are not submitted to the runtime.
Download project exports every Dart tab and a README in one ZIP archive.