Online Dart Compiler
Run Dart online with Dart 3.14. Write a program with a main function, press Run, and it runs on the Dart VM with the output beside your code and errors shown with line numbers. Programs can read input with stdin.readLineSync, and the libraries in the Dart SDK are ready to import.
How to run Dart code online
- This page opens with Dart selected, so you can start typing straight away.
- Write your code in the editor, or open files from your computer: single files, or a whole project as a .zip.
- Press Run, or Ctrl+Enter. The output appears in the panel beside the editor, and when the program asks for input you type it there and press Enter.
- Share a copy with a link, or save your files to your computer.
Dart 3.14 on Online IDE
- Your program runs on the Dart VM with dart main.dart, starting in main().
- Read a line with stdin.readLineSync() from dart:io and type it in the output panel while the program waits.
- stdout.write shows a prompt without a new line, where print would add one.
- The libraries in the Dart SDK, such as dart:io, dart:math and dart:convert, are available, but packages from pub.dev are not.
Example: a Dart program that reads input
import 'dart:io';
void main() {
stdout.write('Enter a sentence: ');
final sentence = stdin.readLineSync() ?? '';
final words = sentence.split(' ').where((w) => w.isNotEmpty).length;
final vowels = sentence.toLowerCase().split('').where((c) => 'aeiou'.contains(c)).length;
print('$words words, ${sentence.length} characters and $vowels vowels.');
}
Features of this tool
- Simple and fastA clean, lightweight editor that opens instantly.
- Powered by AceThe Ace code editor, with syntax highlighting, autocompletion and bracket matching.
- Interactive programsType input into the terminal while your program runs.
- Several filesWork in tabs, open files or a .zip from your computer, and save the project back to disk.
- Made for learningHelpful for beginners to learn and practice programs.
- Light and dark themesPlus 39 editor themes, a choice of coding fonts, and Vim, Emacs or VS Code keys.
- Keep your outputCopy or download the program output in one click.
- Share by linkSave your code in the cloud and open it anywhere.
Frequently asked questions
Which Dart version does Online IDE use?
Dart 3.14, run on the Dart VM with dart main.dart, on Linux.
Can I run Flutter code here?
No. Programs print to a terminal on Linux, so there is no screen for Flutter widgets. Command-line Dart with the SDK libraries works.
How does a Dart program read input?
Import dart:io and call stdin.readLineSync(), then type into the output panel while the program waits and press Enter.
Can I use packages from pub.dev?
No. The libraries that come with the Dart SDK work, but pub packages are not installed and programs cannot download them.
Contact us
For any feedback, queries or issues, please feel free to contact us or write to . We value your input and are committed to providing the best possible experience for our users.