Skip to content
Nicetitle is an implementation of John Gruber's
Branch: master
Clone or download
Latest commit 059d24b May 29, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin First commit May 26, 2019
lib Bump version May 26, 2019
test Add shorthand and fix readme May 26, 2019
.gitignore First commit May 26, 2019
Gemfile First commit May 26, 2019
LICENSE.txt First commit May 26, 2019 Add badges May 29, 2019
Rakefile First commit May 26, 2019
nicetitle.gemspec First commit May 26, 2019

Gem Version License Last Commit


Nicetitle is an implementation of John Gruber's

The rule set is:

  • Small words such as "a", "an", and "but" are not capitalized:
    • except for the word "is";
    • except if the previous word ended with a colon.
  • The first and last words are always capitalized, even if they're small words.
  • Words starting with (, _, ', or " are capitalized e.g. __foo becomes __Foo.
  • Words starting with a dash, or words interspersed with dashes, are capitalized after every dash e.g. -Foo-bar becomes -Foo-Bar.
  • Words interspersed with slashes are capitalized "between" every slash e.g. foo/bar becomes Foo/Bar.
  • Words starting with a slash are not capitalized.
  • URLs are not capitalized.
  • Words containing capitals other than the first character are not capitalized e.g. iOS remains untouched.
  • Words containing dots are not capitalized.
  • All caps sentences are down-cased before applying above mentioned rules.

Check out the test cases for a detailed overview.


Add this line to your application's Gemfile:

gem 'nicetitle'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nicetitle



Nice.title('What am I reading/listing/applying these days?')


What Am I Reading/Listing/Applying These Days?


Bug reports and pull requests are welcome on GitHub at


The gem is available as open source under the terms of the MIT License.

Similar projects

I've written an article about title casing. This article mentions the following similar projects:

You can’t perform that action at this time.