Online JavaScript Editor
Write modern JavaScript and see console output instantly. Undefined names, const mistakes and typos are marked with a suggested fix.
Run JavaScript online with instant error help
Write JavaScript and press Run to see console.log output on the right. The code runs in a separate background worker in your browser, so it is private and you can stop it at any time.
The editor finds common mistakes while you type: a name that is not defined (with a "did you mean" suggestion), changing a const, = instead of === in a condition, a loop that reads one item too far, a typo such as .lenght, and missing brackets, quotes or commas. Each problem has a button that fixes it.
This mode has no page, so document and window are not available here. To work with a web page, use the HTML, CSS and JavaScript playground.
Frequently asked questions
Can I use async/await and modules?
Yes. Modern syntax such as async/await, classes, optional chaining and top-level await works.
Why is document not defined?
JavaScript mode runs in a worker without a web page. Choose HTML to write a page and use the DOM.
How do I read input?
Use prompt(); it reads the next line from the Input tab.
What if my code never stops?
Press Stop. Code that runs more than 30 seconds is stopped automatically.
Is it free?
Yes. There is no signup, and your code stays in your browser.
Looking for another language? Open the full code editor with 100+ languages.