PublicSoftTools

Online Code Compiler — Run Code in Your Browser

Write and run Python, Java, C++, or JavaScript code instantly with no installation. Paste your code, add optional input, and click Run. No signup, no setup — runs entirely in your browser.

Tips for Using the Code Compiler

Tab indentation

Press Tab inside the editor to insert 4 spaces. This keeps Python indentation clean without switching to a text editor.

Multi-line stdin

Open the stdin panel and enter each input on a new line. Programs reading multiple inputs (e.g. loop-based) will receive them in order.

Debug with stderr

Error output appears in red below stdout. Stack traces, compilation errors, and runtime exceptions are all shown separately for easy diagnosis.

JavaScript readline

In JavaScript mode, use readline() to read a line from stdin. It works like Python's input() — useful for competitive programming problems.

Check execution time

The execution time in milliseconds appears in the output header. Use it to compare algorithm efficiency — e.g., O(n log n) sort vs O(n²) sort on large input.

Frequently Asked Questions

Which languages are supported?

JavaScript, Python 3, Java, and C++. JavaScript runs entirely in your browser using a Web Worker. Python, Java, and C++ are executed via the Piston open-source execution engine.

Is my code stored or logged anywhere?

No. JavaScript runs locally in your browser and never leaves your machine. For Python, Java, and C++, code is sent to the Piston API for execution but is not stored — it is executed transiently and discarded.

How do I provide input to my program?

Click the "Show stdin" button to reveal the standard input field. Enter your input there before clicking Run. For Python, use input(). For Java, use Scanner. For C++, use cin. For JavaScript, the readline() function is available.

Why is JavaScript execution instant while other languages take a few seconds?

JavaScript runs in a Web Worker directly in your browser, so there is no network round-trip. Python, Java, and C++ require a request to the Piston execution service, which adds a small network and startup delay.

What happens if my code runs forever?

JavaScript execution is capped at 10 seconds and will terminate automatically. Python, Java, and C++ have a timeout enforced by the Piston service (typically 3-5 seconds). An error message is shown if the timeout is hit.

Is there a code size or output limit?

There is no hard limit on code size. Output is truncated at the limits imposed by the Piston API (typically a few hundred KB). Very large outputs may be cut off.

Can I import libraries?

Standard library imports are supported for all languages (e.g. math, os in Python; java.util in Java; iostream in C++). Third-party packages (like NumPy or Gson) are not available in the execution environment.