C Ruby Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.


{}j gem

Build Status AppVeyor Gem Gem SemVer compatibility

A fast JSON parser and Object marshaller as a Ruby gem.

Version 3.0 is out! 3.0 provides better json gem and Rails compatibility. It also provides additional optimization options.


require 'oj'

h = { 'one' => 1, 'array' => [ true, false ] }
json = Oj.dump(h)

# json =
# {
#   "one":1,
#   "array":[
#     true,
#     false
#   ]
# }

h2 = Oj.load(json)
puts "Same? #{h == h2}"
# true


gem install oj

or in Bundler:

gem 'oj'

Further Reading

For more details on options, modes, advanced features, and more follow these links.


See {file:CHANGELOG.md}


Follow @peterohler on Twitter for announcements and news about the Oj gem.

Performance Comparisons

Links of Interest