Online Clojure Compiler
Run Clojure online with Clojure 1.12 on Java 17. Write your forms, press Run, and each one is compiled and run in turn, with exceptions shown beside your code. Programs can read input with read-line as they run, and clojure.string, clojure.set and the Java class library are ready to use.
How to run Clojure code online
- This page opens with Clojure 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.
Clojure 1.12 on Online IDE
- Your program runs with Clojure 1.12 on Java 17, one top-level form after another.
- (read-line) reads a line of input, and output shows as soon as it is written, so a prompt from print appears first.
- parse-long returns nil instead of throwing on text that is not a number.
- clojure.core, clojure.string, clojure.set and the Java class library are available, but deps.edn and Leiningen dependencies are not.
Example: a Clojure program that reads input
(require '[clojure.string :as str])
(print "Enter a whole number: ")
(let [n (parse-long (str/trim (or (read-line) "")))]
(if (and n (pos? n))
(println (str "Divisors of " n ": " (str/join ", " (filter #(zero? (mod n %)) (range 1 (inc n))))))
(println "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 Clojure version does Online IDE use?
Clojure 1.12 on Java 17, running your file with clojure.main.
Can a Clojure program read input?
Yes. (read-line) returns the next line, or nil at the end of the input. Type into the output panel while the program waits and press Enter.
Can I call Java classes?
Yes. Java interop works as usual, for example (java.time.LocalDate/now) or (.toUpperCase "text").
Can I add libraries?
No. Programs cannot download dependencies. The libraries that come with Clojure 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.