JavaScript Code
Output
 
About JavaScript Runner

A Safe Place to Run JavaScript

Sometimes you just need to test a quick idea — a utility function, a sorting algorithm, or some string manipulation. Opening DevTools works, but the console is cramped and you lose your code on refresh. This runner gives you a proper editor with syntax highlighting and runs your code in a sandboxed iframe, so it can't affect the page.

What You Can Do

  • Write and test functions with console.log output
  • Prototype algorithms before putting them in your project
  • Debug tricky logic with quick experiments
  • Share code snippets — your code stays in the editor between visits

How It Works

Your code runs inside a sandboxed <iframe> with its own execution context. Console output is captured and displayed in the output panel. If your code throws, you'll see the error with a stack trace. The sandbox prevents your code from accessing the parent page.

Frequently asked questions

Is it safe to run code here?

Code runs in your own browser sandbox, not on a server, so it only has access to your local browser environment.

Can I test functions with inputs?

Yes — write a function and execute it to see the output immediately.

Are my scripts saved?

Your work is stored locally in your browser so it's still there when you return.

Related tools

From the blog