Swelıty
Tools for everyone

Free Online Ruby Playground

Run Ruby 3.4 code in your browser and see everything you print in a console. The real Ruby interpreter, no install needed.

Press Run, or Ctrl or Cmd + Enter, to run your code. Everything you puts or print shows in Console. The first run downloads Ruby, which is about 30 MB. Use Stop if your code never ends. gets is not available.

main.rb

Preview

Console

Output appears here. Press Run, then try console.log("Hello")

How to use

  1. Write your Ruby code in the main.rb tab.

  2. Press Run, or Ctrl or Cmd + Enter. Everything you puts, print or p appears in the Console panel. The first run downloads about 30 MB.

  3. Press Stop if your code never finishes.

  4. Copy the code, download a zip of your files or clear the editor with the icons above it.

  5. Open the full screen editor for more room, and use the A buttons to resize the text.

  6. Untick Wrap long lines to scroll sideways instead of wrapping.

Why use this tool

  • Real Ruby 3.4

    The standard CRuby interpreter and library, compiled to WebAssembly.

  • Built-in console

    Output from puts, print and p appears beside the preview, and errors come with line numbers.

  • Runs in your browser

    Nothing to install: the code runs in your browser.

  • Isolated preview

    Your code runs in an isolated frame, so it cannot reach this site or your other tabs.

  • Comfortable editor

    Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.

About this tool

Run Ruby 3.4 in your browser with nothing to install. Write your program in the main.rb tab, press Run, and read what it prints in the console. This is the real Ruby interpreter compiled to WebAssembly, so classes, modules, blocks, pattern matching and the standard library behave as they do on your own machine. It suits learning Ruby, testing a snippet, or checking how a method works. The first run downloads about 30 MB, and your browser keeps it afterwards.

Frequently asked questions

Ruby 3.4, the standard CRuby interpreter compiled to WebAssembly by the ruby.wasm project. It is loaded from a public CDN and verified with an integrity check.

Ruby and its standard library are a single download of about 30 MB. Your browser keeps it, so later runs start much faster.

No, gems cannot be installed here, but Ruby's standard library is included. Anything that needs an operating system, such as files, sockets and processes, is not available.

No. There is no keyboard input, so gets returns nothing. Put your test data in the code.

Yes, the first time you press Run, because Ruby is fetched from a public CDN.

Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.