// Write code here, then press Run (Ctrl/Cmd + Enter).
console.log('Hello, World!');
Press Run (Ctrl + Enter) to see the output.
About this online JavaScript compiler
This online JavaScript compiler runs your code right in your browser and shows the console output the moment you press Run. There is nothing to install and no sign-up: open the page, type JavaScript and see what it prints.
It is built for learning and quick experiments: trying an array method, checking how a closure behaves, testing a regular expression or a snippet from an interview question. When something throws, the error message names the line it came from, so you can fix it fast.
How to use the JavaScript compiler
- Write or paste JavaScript in the editor on the left (on a phone, the Code tab).
- Press Run, or Ctrl + Enter, to run it.
- Read console.log output and errors in the Output panel; each error ends with its line number.
- Press Share to save your code as an image or copy a link to it; Reset brings back the hello world starter.
Keyboard shortcuts
- Ctrl + Enter (Cmd + Enter on a Mac)
- Run the code
- Ctrl + / (Cmd + / on a Mac)
- Comment or uncomment the selected lines
- Ctrl + Z, Ctrl + Shift + Z
- Undo and redo
- Tab, Shift + Tab
- Indent or outdent the selection
- Escape, then Tab
- Leave the editor and move to the next control
What it supports
- Modern JavaScript: let and const, arrow functions, classes with private fields, destructuring, spread, optional chaining, Map and Set.
- Top-level await, promises, async functions and timers such as setTimeout and setInterval.
- console.log, info, warn, error and table, with arrays and objects printed readably.
- Line numbers for runtime errors and syntax errors.
- Several files: add files and folders in the Files panel, import and export between them, and save the whole project as a .zip file.
- Your latest code is kept in this browser, so it is still there when you come back.
Limits to know
- Code runs in an isolated sandbox: no network requests, no access to the page or to other sites, and a fresh in-memory localStorage on every run.
- A run stops after 8 seconds, so an endless loop never freezes the page.
- There are no npm packages: add files and folders in the Files panel and import them with relative paths, like ./utils.js. For web pages with DOM code, use the HTML CSS editor.
Example: Array methods
main.js
const nums = [5, 1, 4];
const doubled = nums.map((n) => n * 2);
console.log(doubled);
console.log('Sum:', nums.reduce((a, b) => a + b, 0));Output
[10, 2, 8] Sum: 10
Frequently asked questions
Is this JavaScript compiler free?
Yes. Every editor in the DevArcade playground is free to use, with no sign-up, no account and no limit on runs.
How do I run JavaScript code online?
Type or paste your code into the editor and press Run, or Ctrl + Enter (Cmd + Enter on a Mac). The console output appears in the Output panel right away, along with any error and the line it happened on.
Can I use console.log, async/await and setTimeout?
Yes. console.log and the other console methods print to the Output panel, and promises, async/await, setTimeout and setInterval work as in a browser. The run waits for pending timers before it finishes.
How do I share my JavaScript code?
Press the share key next to Run. Copy link packs the code into the link itself, so whoever opens it sees your code and can run it with one press of Run; nothing is uploaded to a server. You can also save the code as a PNG image to post anywhere.
Can I fetch data or use npm packages?
No. Code runs in a sandbox without network access or packages, which keeps it safe. To practise fetch, write a small fake that returns a promise with your sample data.
Is this a real JavaScript compiler?
JavaScript has no separate compile step that you run yourself: the engine in your browser reads your code and compiles it to machine code as it runs. This tool hands your code to that same engine, the one that runs JavaScript on every website, so Run gives you the real result at full speed.
Does it support Node.js, require or fs?
No. Your code runs as JavaScript does in a browser, so Node.js modules such as fs, path and http are not available to import or require. Use import and export between files in the Files panel instead, and save the project as a .zip file to run it with Node.js on your own computer.
Can I run JavaScript on my phone?
Yes. On a phone the page has a Code tab and an Output tab: write in Code, press Run, and the output is one tap away. It works in any modern mobile browser, with nothing to install.
Also try
- Online TypeScript compilerRun TypeScript with real type checking: type errors are underlined as you type.
- Online React compilerWrite a React component in JSX or TSX and use it in a live preview.
- Online HTML CSS editorBuild a web page in index.html, style.css and script.js with a live preview.