Only whitespace is rewritten: indentation is re-levelled and long lines can be wrapped, while strings, heredocs and operators are copied byte for byte. This is a layout formatter, not a linter — it does not check or repair syntax.
Runs locally in your browserPaste a Ruby snippet and the tool returns the same program with re-levelled indentation, a blank-line policy and optional line wrapping. Only whitespace between tokens is rewritten: strings, heredocs, percent literals, regexes, comments and operators are copied byte for byte, so the result parses to the same syntax tree as the input.
The formatter runs entirely in this browser tab and nothing is uploaded. It is a layout formatter, not a linter: it does not check, run or repair Ruby, and it never reports an error, so a snippet with a missing end comes back laid out rather than fixed.
Only whitespace between tokens is rewritten: leading indentation is re-levelled to the chosen unit, trailing spaces and surplus blank lines are removed, and long lines can be wrapped. Everything else is copied byte for byte — single-quoted, double-quoted and backtick strings, heredocs (<<, <<-, <<~ and quoted terminators such as <<-'end;'), percent literals (%w, %W, %i, %I, %q, %Q, %r, %s, %x), regular expressions including multi-line ones, symbols and labels, and operators such as **, &., &:, ::, <<, -> and =>.
A quick check on any result: the output holds the same tokens in the same order as the input, only re-spaced. If your project also runs RuboCop or rufo in the editor, this page does not replace that pass — it is for reading a snippet, not for a build step.
Each deeper indent step in the input becomes one unit of the selected width, so tabs, 2, 3, 4 and 8 spaces all produce a consistent block structure. Bodies follow def, class, module, if, unless, while, until, case, begin, for and do … end; modifier forms such as x if y are not treated as blocks, and a line that continues an unfinished expression stays attached to its statement.
The blank-line setting caps runs of empty lines: remove them, keep at most one or two (the default keeps two), or keep all of them. Wrapping is greedy and only breaks after a comma or after a value followed by a binary operator — positions where Ruby continues the line itself — so a token is never split; a line without such a point stays long instead of being cut.
It is not a linter, a style fixer or an interpreter. Nothing is executed, no names are renamed, requires are not sorted, quotes are not converted, and a missing end is not reported. Heredoc bodies, =begin/=end blocks and the __END__ data section are copied untouched, including the whitespace inside them.
Because the program is never parsed, the page cannot tell you that the input is invalid. Run the result through ruby -c or your editor's checker when you need to know that it is valid.