Online JavaScript Compiler
Run JavaScript online with Node.js 24. Write your program, press Run, and see the output beside your code, with error messages and line numbers if something goes wrong. Programs can read input with readline as they run, and the version menu switches to Node.js 22 or 26.
How to run JavaScript code online
- This page opens with JavaScript 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.
Node.js 24 on Online IDE
- Programs run in Node.js, not in a web page, so there is no document or window. console.log writes to the output panel.
- Read input with readline or process.stdin and type it in the output panel while the program runs.
- Split a program into several files and load them with require('./name'). Only Node's built-in modules are installed, and programs cannot download packages.
- Pick Node.js 22 or 26 in the version menu next to the language menu.
Example: a JavaScript program that reads input
const readline = require('node:readline');
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
rl.question('Enter two numbers separated by a space: ', (line) => {
const [a, b] = line.split(' ').map(Number);
console.log(`${a} + ${b} = ${a + b}`);
rl.close();
});
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 JavaScript engine does Online IDE use?
Node.js 24, which runs on Google's V8 engine, on Linux. You can switch to Node.js 22 or 26 in the version menu.
Can I use the DOM, window or fetch here?
No. Your code runs in Node.js on our server, so there is no page to change. Programs also have no network access, so fetch cannot reach other websites.
How does a JavaScript program read input?
Use readline's question() or listen for lines on process.stdin, then type into the output panel and press Enter.
Can I import npm packages?
No. Node's built-in modules such as fs, path, readline and util work, but npm packages are not installed and cannot be downloaded.
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.