JavaScript Tester
Run JavaScript and see its console output, in a fully sandboxed iframe.
Runs in a sandboxed iframe with no access to this page, cookies, or the network — safe to try code you don't fully trust. Only console.log/warn/error/info output and uncaught errors are captured. Nothing you write is sent anywhere.
Need the opposite? JavaScript Validator
What is JavaScript Tester?
Paste JavaScript, click Run, and see its console.log output, executed in a sandboxed iframe with no access to this page, your cookies, or the network, so it's safe to try code you don't fully trust. Useful for quickly testing a code snippet, checking how a method behaves, or running an untrusted script from a tutorial or Stack Overflow answer without pasting it into your own project or browser devtools console first.
How to Use the JavaScript Tester
- 1
Paste the JavaScript: Enter the code snippet you want to run.
- 2
Click Run: Execute the code inside the sandboxed iframe.
- 3
Read the Console Output: View console.log/warn/error output, and any uncaught errors, in the output panel.
How It Works
Clicking Run injects the pasted code into a fresh iframe sandboxed with `allow-scripts` only (no `allow-same-origin`), which strips it of access to this page's DOM, cookies, and local storage, and blocks meaningful network requests. The iframe's `console.log`/`warn`/`error`/`info` calls are intercepted and streamed back to the output panel, along with any uncaught runtime error, instead of going to the browser's own devtools console.
Example
Input:
const nums = [1, 2, 3, 4];
const doubled = nums.map(n => n * 2);
console.log(doubled);
console.log('sum:', doubled.reduce((a, b) => a + b, 0));
Output:
[2, 4, 6, 8]
sum: 20What It Catches
Runtime errors, not just syntax errors. Since the code actually executes, a thrown exception (like calling `.map()` on `undefined`, or referencing an undeclared variable) shows up in the output as an uncaught error, the same way it would in a real browser console.
Frequently Asked Questions
Common questions about JavaScript Tester.