RubyHash started with a simple frustration: staring at two walls of Ruby hash output in the terminal, trying to figure out which key changed. Every Ruby developer who has worked with Minitest knows the feeling. Your test fails, the diff dumps two nearly identical hashes, and you're left squinting at curly braces and hashrockets trying to spot the one value that's different.
So I built a tool to fix it. Paste your Minitest hash diff, and RubyHash converts the Ruby hash syntax to sorted JSON and renders a clean, highlighted side-by-side comparison. It handles hashrockets, symbol keys, nested hashes, arrays, nil values, and all the other quirks of Ruby's hash syntax. No sign-up, no install, just paste and compare.
Under the hood, RubyHash uses a hand-written recursive descent parser that converts Ruby hash syntax into JavaScript objects. It's not a regex hack or a simple find-and-replace. The parser handles every Ruby hash format: :symbol => value hashrockets, "string" => value keys, modern key: value syntax, nested hashes, arrays, nil/true/false, quoted symbols, and escape sequences. Once parsed, the objects are sorted by key and rendered as formatted JSON so you can see exactly what changed.
The diff viewer also detects type changes between the expected and actual values. If a field changed from nil to a string, or from a number to an object, you'll see a type badge highlighting the change. This catches a whole class of bugs that are easy to miss when you're just reading raw hash output.
Beyond the tool, RubyHash publishes articles about Ruby, Rails, testing, and developer tooling. The blog covers topics like metaprogramming best practices, Ruby's Enumerable module, duck typing, testing culture, pattern matching, ActiveRecord performance, and more. Every post is written from practical experience, with real code examples and opinionated takes on what works and what doesn't.
Whether you're a seasoned Rubyist or picking up the language for the first time, the goal is the same: help you write better Ruby code and debug it faster when something goes wrong.
RubyHash is built and maintained by Lachlan Young, a software developer who works with Ruby and Rails daily. I built RubyHash because I needed it myself, and I keep writing about Ruby because it's a language that rewards depth. The more you learn about how Ruby works under the hood, the better your code gets.
The Ruby hash parser that powers this tool is open source and runs entirely in your browser. No data is sent to any server. Your hash diffs stay on your machine.
Get new articles and tool updates delivered to your inbox. No spam, unsubscribe anytime.