Online Racket Compiler
Run Racket online with Racket 9.3. Start your file with #lang racket, press Run, and see what it prints beside your code, with errors shown by line. Programs can read input with read-line as they run, and the racket and racket/base libraries are ready to use.
How to run Racket code online
- This page opens with Racket 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.
Racket 9.3 on Online IDE
- Your program runs with Racket 9.3 and starts with a #lang line, such as #lang racket or #lang racket/base.
- (read-line) reads a line of input, and output shows as soon as it is written, so a prompt from display appears first.
- string->number returns #f instead of raising an error on text that is not a number.
- The racket and racket/base languages and their libraries are available, but raco cannot install packages.
Example: a Racket program that reads input
#lang racket
(display "Enter a whole number: ")
(define n (string->number (string-trim (read-line))))
(if (exact-positive-integer? n)
(printf "Divisors of ~a: ~a\n" n (filter (λ (d) (zero? (remainder n d))) (range 1 (add1 n))))
(displayln "Please enter a whole number above zero."))
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 Racket version does Online IDE use?
Racket 9.3 on Chez Scheme, running your file as a module.
Can I write Scheme?
Much Scheme code runs under #lang racket. The r5rs, r6rs and SICP languages are not installed.
Can a Racket program read input?
Yes. (read-line) reads a line and (read) reads a datum. Type into the output panel while the program waits and press Enter.
Can I install packages with raco?
No. Programs cannot download packages. The base libraries that come with Racket are available.
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.