Ruby Formatter

Indent Ruby code blocks consistently.

Ruby Formatter

.rb

Paste text or open a file to see the result.

What it does

Indents Ruby blocks, methods and classes consistently. Handy for scripts and Rails code where nested do and end blocks get hard to match. You get the same Ruby, easier to read.

About the .rb format

.RB file extension

.rb Ruby Source Code

Developer Files

File Type
Ruby Source Code
MIME
application/x-ruby

In this tutorial, we will learn about the extension of the .rb file which is used as a Ruby source code.

Ruby Formatter questions

How do I use the Ruby Formatter?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .rb change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .rb page lists programs and converters for it.