How to Run Python, Ruby, PHP, Lua and C Code in the Browser
Run small programs in five languages without installing anything: how WebAssembly runtimes work, using stdin and files, sharing code and the limits.

How to Run Python, Ruby, PHP, Lua and C Code in the Browser
Sometimes you just want to run twenty lines of code: check a Python one-liner, test a PHP function, try Lua for a game script or run a C exercise. Installing interpreters is overkill on a borrowed laptop, and many online compilers send your code to their servers. The free multi-language code playground takes a different route: the interpreters themselves run in your browser as WebAssembly.
What WebAssembly changes
WebAssembly is a compact binary format that browsers execute at near-native speed in a sandbox. Projects such as Pyodide, ruby.wasm and php-wasm compile the real interpreters, CPython, CRuby and the PHP engine, to WebAssembly. wasmoon does the same for Lua 5.4, and picoc-js packages the small PicoC interpreter for C. The playground downloads the runtime you choose from jsDelivr the first time you press Run, then the browser caches it. Your code never leaves the device; there is no server executing it.
The first start of each language takes a moment: Lua and C are under one megabyte, Ruby about two, Python about ten and PHP about thirteen. After that, runs start instantly.
Give your program input
Most exercises read input. Type it in the stdin box, one value per line, exactly as you would type it in a terminal. Python's input(), Ruby's gets, PHP's fgets(STDIN), Lua's io.read and C's scanf all read from it. Keeping test input in the box means you can rerun the program with the same data again and again, which is the basis of debugging.
Work with files
Programs that process data usually open files. Add a CSV, text or JSON file in the Files tab, or upload one, and it is placed in the working directory before each run. When the program writes a file, such as a report or a converted CSV, it appears in the panel afterwards with a download button. This makes the playground useful for small data tasks, not only exercises. The C interpreter has no file system, so feed C programs through stdin.
Keep and share snippets
Every snippet is saved in your browser with its language, input and files. Name them by exercise or topic. To share, copy the share link: the snippet is compressed and stored after the # in the address, a part browsers never send to a server. A teacher can post a link with a starting program and test input; students open it and get their own copy. For longer work, download the source or a ZIP with code, input and files.
Language notes
Python packages that Pyodide provides, including numpy and pandas, load automatically when imported. Ruby runs the standard library; reading and writing files works through the Files panel. PHP 8.4 runs as a command-line script with standard functions. Lua has its full standard library with print and io.read. PicoC covers most of classic C with the usual headers, which is enough for course exercises but not for large projects.
Debugging tips
Print intermediate values generously, because there is no step debugger. Test loops on small inputs first: a program that never ends will freeze the browser tab, since it runs on the page's main thread. If that happens, close the tab and reopen the page; your snippet is still saved.
Limits
These runtimes cannot open network connections, start threads or load native extensions, and performance is lower than a native interpreter. PicoC is an interpreter with partial standard library support, not an optimising compiler, so results of undefined behaviour may differ from GCC or Clang. For coursework, always confirm on the toolchain your course requires.



