You have to buy the Japan Rail pass before traveling to Japan, either online or at your country tourism office retailers.
Price varies according to duration (7, 14 or 21 days), and covered area size.
For regular national pass, prices are 275, 440 and 560$, while for kids between 6 and 12 years prices are halved.
If you plan to stay within a small area, you can save money with regional pass version to travel between a small set of prefectures.
Considering that a 1-way bullet train ticket from Tokyo to Kyoto is 120$ and the 1-way train ticket from Tokyo to Narita airport is 35$, a 7-day JR pass (275$) is clearly convenient!
In general, JR pass might not be worth only if you are planning to stay in a single city doing 1-day trips.
For all other itineraries, the JR pass is highly recommended.
In order to make it more valuable, try to plan your itinerary to maximize the pass duration.
For example, inside our 10-day itinerary we use a 7-day JR pass planning the most expensive travels within 7 days, while the last 3 days are used to explore Tokyo.
Hoping to have been useful, have a safe travel to Japan.