Run Dart console programs online. Your code is compiled and run by the stable Dart SDK in a secure sandbox on the K-Programmer engine, with null safety, records, patterns, classes, mixins, extension methods and dart:io, dart:math and dart:collection.
Unlike most Dart playgrounds, this one supports standard input: read the Input box with stdin.readLineSync(), exactly as on your computer. It is the quickest way to practise Dart before Flutter. Pick one of six samples or write your own; your code is saved automatically.
How to use the Dart Online Compiler tool
- Choose a sample or write a Dart program with a
main()function. - Type the input lines for
stdin.readLineSync()in the Input box. - Click Run or press Ctrl+Enter.
- Read the output or the analyzer errors with line numbers.
- Share the program or open it in K-Programmer to learn Flutter next.
Why use ToolOrca Dart Online Compiler
- Stable Dart SDK with sound null safety, records and patterns
- Standard input with
stdin.readLineSync()(most playgrounds lack this) dart:iostdout,dart:math,dart:collection- Compile errors with line numbers, runtime exceptions, run time
- Syntax highlighting, line numbers, auto-indent, Ctrl+Enter
- Six samples, autosave and share links
Reading input in Dart
Import dart:io and call stdin.readLineSync(); each call returns the next line of the Input box, or null when there are no more lines. Convert with int.parse(...) or int.tryParse(...) ?? 0, and split a line of numbers with split(" ") as the samples do.
Use stdout.write() for a prompt without a new line, and print() for normal output.
Dart console or Flutter?
This page runs console programs (no user interface). To build and preview Flutter apps with widgets, use the Flutter online compiler, which embeds DartPad.
Each run gets 5 seconds, 512 MB of memory and no network, so packages from pub.dev and HTTP requests are not available; the core libraries are.
Learn Dart and Flutter
The samples cover output, input, loops, lists and maps with where/map, functions with named parameters, classes with getters, and merge sort.
K-Programmer has Dart and Flutter courses with quizzes and live Flutter previews.
Frequently asked questions
Which Dart version is used?
The current stable Dart SDK (Dart 3), with sound null safety.
Can I read input with stdin?
Yes. Type the input in the Input box and read it line by line with stdin.readLineSync().
Can I run Flutter here?
Flutter apps need a different runner: use the Flutter online compiler page, which shows the app in DartPad.
How do I share my code?
Click Share code. The link that is copied contains your code and input, compressed, after the # sign, so nothing is stored on a server and the link works as long as you keep it.
What is "Open in K-Programmer"?
K-Programmer is a free platform for learning to code, with lessons, quizzes, contests and the same online compiler. The button copies your code and opens K-Programmer, where you choose the language, paste the code and keep working (sign in to save programs).