Online JavaScript compiler
Run JavaScript online free on Node.js, no sign-up: read input from stdin, print with console.log and see the output, errors and run time instantly.
How do I run JavaScript code online?
This is an online JavaScript compiler that runs your code on Node.js: write a script, put its input in the Input box and press Run, and you see what console.log printed, the error and its stack if one was thrown, and the run time — free, with no sign-up.
How it works
- Write your program. A JavaScript program is a script run top to bottom by Node.js. There is no browser here — no document, window, alert() or prompt() — so print with console.log and read input from standard input.
- Give it input. require("fs").readFileSync(0, "utf8") reads all of standard input as one string; split it with .split("\n") for lines or .split(/\s+/) for words, and turn values into numbers with Number(). Put every line the program reads in the Input box before you run it.
- Run it. Press Run or Ctrl+Enter. You get what the program printed, any compiler or runtime error, and how long it ran. The first run without an account asks a quick check that you are a person.
Who it is for
Anyone writing JavaScript who wants it run now: a student checking a lab program or an exam answer, someone on a machine where nothing can be installed, or a learner trying JavaScript before setting it up.