Calculators and Converters

The following is a large collection of mathematical, scientific, and many special purpose calculators and converters, all using JavaScript. You can use these to do basic or advanced math, convert metric to English and vice versa, and much more.

Math (Basic)
   5 Function Calculator
   Windows Calculator

Math (Advanced General)
   High-Tech Calculator
   Expression Solver

Math (Specific Functions)
   Area Calculator
   Area/Volume Generator
   Bubble Sort
   Circle Solver
   Cosine Calculator
   Sine Calculator
   Tangent Calculator
   Function Grapher
   Graphing Function
   Greatest Common Factor
   LCM and GCD
   Parabola Grapher
   Percent Calculator
   Percent of Increase
   Prime Number Calculator
   Pythagorean Theorem
   Quadratic Solver
   Random Distribution
   Square Root Calculator

   Acceleration Equivalents
   Area Equivalents
   Base Converter
   Binary Converter
   Degrees to Radians
   Energy Equivalents
   Euro Converter
   Hertz Converter
   JRM Calculain
   KB to MB
   Length Equivalents
   Mass Equivalents
   Metrology Equivalents
   Litres to Miles Per Gallon
   Minutes and Seconds Converter
   Morse Code
   Phone Number Converter
   Power Equivalents
   Pressure Equivalents
   Temperature Converter
   Time Converter
   Unix Date-Time Converter
   Velocity Equivalents
   Write Out Number

   Adjusted Cost Base
   Compound Interest
   Income Calculator
   Interest Calculator
   Money Counter
   Paycheck Calculator
   Savings Estimator
   Stock Calculator
   Tax Calculator

   Age Calculator
   Date Difference
   Day of Week
   Leap Year Calculator

   Airport Calculator
   Distance Speed Time
   Driving Distance Calculator
   Horsepower Calculator
   Miles per Gallon
   MPH to RPM Converter
   Straight Distance

   Atmosphere Calculator
   Kinetic Energy
   Periodic Table
   Radioactive Calculator
   Wind Chill Calculator

   Body Calculator
   Body Mass Index
   Calorie Calculator
   Male Body Calculator
   Pregnancy Calculator
   Lap Time
   Playoff Chart Maker
   Running Calculator

Web Design
   Download Calculator
   Hex - RGB Converter
   RGB Slider

   Beat Counter
   Wavelength Calculator

   Ad Calculator
   Armor Penetration Calculator
   ASCII Engine
   Astrological Calculator
   Field Depth Calculator
   GPA Calculator
   Paint Calculator
   Phone Bill
   Phone Number Converter
   Room Size Calculator
   World Population
--> Math (Basic)

Title: 5 Function Calculator
Description: Here is a really simple JavaScript calculator - with just 5 functions! (Add, subtract, multiply, divide, and power.) This example can help you see how JavaScript evaluates math functions.

Title: Windows Calculator
Description: Always been fond of the calculator within Microsoft Windows? This JavaScript mimics the Windows calculator in appearance and function. Everyone, including Macintosh computer users, can now have their own Windows Calculator!

back to the top

--> Math (Advanced General)

Title: High-Tech Calculator
Description: This calculator can do everything! Besides the basic functions (add, subtract, multiply, and divide), it can also take the reciprocal, cos, sin, and tan of a number, square root, and has special square and cube buttons. Also does any power of a number you want, and looks great at the same time.

Title: Expression Solver
Description: Just enter a math expression (with +, -, *, and / signs) and this script will evaluate the expression for you. Who needs a calculator when you have JavaScript. ;-)

Title: Fibonacci
Description: Displays the Fibonacci Sequence of Numbers as entered by the user. Warning: This is very processor intensive. Do not enter a large number.

back to the top

--> Math (Specific Functions)

Title: Area Calculator
Description: A simple calculator to determine the area of a square, triangle, rectangle, circle or sphere.

Title: Area/Volume Generator
Description: Need to find the area or circumference of a circle, the area of a rectangle, or the volume of a cylinder? This cool script will find it for you. In addition to the answer, it also gives all the steps needed to solve the equation. (The answer is rounded off.)

Title: Bubble Sort
Description: Sorts using the BubbleSort method. Simply enter a list of numbers into the text box and click sort.

back to the top

Title: Circle Solver
Description: Can't remember the formulae for the other two parts of a circle (area, diameter, or circumference) when you only know one? To the rescue is Circle Solver. Enter the circle area, diameter, or circumference and it will solve for the other two.

Title: Cosine Calculator
Description: Enter the adjacent and hypotenuse angle values and JavaScript will solve the cosine angle for you.

Title: Sine Calculator
Description: Enter the opposite and hypotenuse angle values and JavaScript will solve the sine angle for you.

back to the top

Title: Tangent Calculator
Description: Enter the opposite and adjacent angle values and JavaScript will solve the tangent angle for you.

Title: Factors
Description: Use JavaScript to find out if a number entered is odd or even and the factors of that number.

Title: Function Grapher
Description: Graphs any function you enter on the scale of your choice, assuming you use the correct JavaScript syntax. For example, to use Cos x, use Math.cos(x). Or, for x^2, use Math.pow(x, 2), etc.

back to the top

Title: Graphing Function
Description: Enter the X-Y coordinates for a function and this script will give you the graphing formulas, including Formula, Slope, Y-intercept, Parallel and Perpendicular lines.

Title: Greatest Common Factor
Description: Find the Greatest Common Factor (GCF) of a group of two or three numbers.

Title: LCM and GCD
Description: Calculate the Least Common Multiple and Greatest Common Divisor of two numbers using this short script.

back to the top

Title: Parabola Grapher
Description: Enter a parabolic equation, like 5x^2 + 18x + 27 and this calculator will determine all the vital information about the graph. And, a rough graph of the curve is available.

Title: Percent Calculator
Description: Don't waste another minute dealing with percent problems. This script will solve them for you -- just enter the values!

Title: Percent of Increase
Description: Enter two numbers and JavaScript will help you determine the percent of increase. This is a perfectly simple example of using a JavaScript return function.

back to the top

Title: Polygon
Description: Figure out the number of sides, measure of each exterior angle, and the measure of the interior angle of any polygon. Simply enter one of the three pieces of information!

Title: Prime Number Calculator
Description: Enter a number and JavaScript can instantly tell you if it is a prime number or not.

Title: Pythagorean Theorem
Description: One of geometry's most useful formulas, the Pythagorean Theorem, can be applied to the numbers you enter in JavaScript! Just enter 'A' and 'B' and the script solves for 'C.'

back to the top

Title: Quadratic Solver
Description: Solves quadratic equations for inputted coefficients. Answers can be either real or complex.

Title: Random Distribution
Description: Generate normally distributed random numbers by entering a mean value and standard deviation. Uses the normal law of error to determine an event's given probability.

Title: Square Root Calculator
Description: Allows you to find the value of a number squared or that number's square root. Very easy.

back to the top

--> Converters/Equivalents

Title: Acceleration Equivalents
Description: JavaScript can help you find acceleration equivalents.

Title: Area Equivalents
Description: JavaScript can help you find area equivalents.

Title: Base Converter
Description: Converts input between binary, ternary, quintal, octal, decimal, and hexadecimal bases. Try entering a string of zeroes and ones in the binary field - when you click off, the script displays that number in the other bases.

Title: Binary Converter
Description: Computers read and store the decimal numbers we see every day (1, 5, 10, 100, etc.) as binary numbers, a system of expressing numbers using just 1s and 0s. You simply enter the decimal number and the script will output the binary equivalent. It's a binary converter!

back to the top

Title: Degrees to Radians
Description: Use JavaScript to convert degrees to radians and vice versa.

Title: Energy Equivalents
Description: JavaScript can help you find energy equivalents.

Title: Euro Converter
Description: Click a country button to display currency name and full fixed Euro exchange rate. Press Clear to empty the value boxes and enter either Euro or local amount to convert. Click the appropriate button for conversion of Euro to local or of local to Euro. Conversion will display selected currency exchange rounded to two decimal places.

Title: Hertz Converter
Description: Convert between frequency and beats per minute (i.e. 8 octaves lower). Enter a number in either field, then click outside the text box.

back to the top

Title: JRM Calculain
Description: This is a great calculator script that has many functions. It calculates and has many different conversions available. Works in MSIE and Opera.

Title: KB to MB
Description: Have you ever been confused about the number of kilobytes in a megabyte, or vice-versa? Now you can convert between kilobytes and megabytes with ease.

Title: Length Equivalents
Description: JavaScript can help you find length equivalents.

Title: Mass Equivalents
Description: JavaScript can help you find mass equivalents.

back to the top

Title: Metrology Equivalents
Description: JavaScript can help you find metrology equivalents.

Title: Litres to Miles Per Gallon
Description: Do you think of fuel consumption in miles per gallon, but have to buy your fuel in liters? This script will figure your miles per gallon for you. Enter miles traveled and liters used and the conversion is done for you. (Imperial gallons are used, not U.S. gallons.) IE only.

Title: Minutes and Seconds Converter
Description: A converter from minutes and seconds to decimal and vice versa. Great for GPS and maps.

Title: Morse Code
Description: Converts an English word or phrase into its Morse Code combination of dots and dashes. Analyzing each letter entered individually, as this script demonstrates, is a very useful JavaScript programming technique.

back to the top

Title: Phone Number Converter
Description: Converts an alphanumeric phone number (like 1800 Flowers) to its numeric phone number (e.g., 18003569377). An excellent example of the JavaScript switch() function in use.

Title: Power Equivalents
Description: JavaScript can help you find power equivalents.

Title: Pressure Equivalents
Description: JavaScript can help you find pressure equivalents.

Title: Temperature Converter
Description: Use this script to convert the temperature from Fahrenheit to Celsius and vise versa.

back to the top

Title: Time Converter
Description: Allows for the conversion back and forth from hours, minutes, and seconds to fractional hours. Input validation also ensures the time input does not contain invalid characters. Definitely a time saver for time-related record keeping.

Title: Unix Date-Time Converter
Contributor URL:
Description: Converts a Unix timestamp (in seconds) to a human-readable date. (Based on the standard Unix epoch of 01/01/1970 at 00:00:00 GMT)

Title: Velocity Equivalents
Description: Another way to use JavaScript to find velocity equivalents.

Title: Write Out Number
Description: This script takes a number and converts it to its English equivalent. If you enter 45678 in the number box and click the appropriate button, Forty Five Thousand Six Hundred Seventy Eight appears in the lower box.

back to the top

--> Financial

Title: Adjusted Cost Base
Contributor: Gordon Coverley (
Description: Computes the average cost base (or cost per share) for a series of stock or mutual fund purchases. When a sale is entered, the capital gain (or loss) is calculated.

Title: Amortization
Description: Calculate monthly mortgage payments quickly and easily. Displays an Amortization Table.

Title: Compound Interest
Description: Use JavaScript to calculate compound interest. Warns about doubtful data.

back to the top

Title: Income Calculator
Description: Estimates your weekly, bi-weekly, monthly, and yearly income. Very useful when job hunting when offered an income per hour, month, or year. The tax bracket numbers are adjustable with each year's income tax levels.

Title: Interest Calculator
Description: Use JavaScript to find out just how much that new house or car is going to cost you each month. Enter values into the fields to find out how much each monthly payment would be with the given number of payments, interest rate, and loan amount.

Title: Money Counter
Description: Enter the number of bills and coins and this script will calculate the total amount of money you have. All blank entries are ignored. Input field validation is also included -- try entering a non-digit into a field. Also, this script is a good demonstration of a JavaScript return function in use.

back to the top

Title: Paycheck Calculator
Description: Enter your pay rate and the number of hours you worked and optionally any overtime hours and pay rate, your own tax rate, and other deductions. Click "calculate" and the script tells you how much your weekly paycheck will be.

Title: Savings Estimator
Description: Enter how much you can afford to save each month, how long you can save this amount, and the interest rate you can get on your savings and this script will display your total savings.

Title: Stock Calculator
Description: Deciding when to buy and sell stocks is difficult enough -- figuring the profit or loss from that trade shouldn't have to be. Just enter the number of shares, your purchase price, your selling price, and the commission fees for the trade and this script instantly figures your resulting profit or loss after commission fees.

Title: Tax Calculator
Description: JavaScript helps you to calculate the before and after tax prices for purchases. Very easy to use. Just put in the price, the tax, and hit compute! It's all figured for you!

back to the top

--> Time

Title: Age Calculator
Description: Just enter the birthday you wish to track and JavaScript will display the person's age, down to the second. Displays your age along with the day you were born.

Title: Date Difference
Description: Enter two dates (including the time!) and this script will display the number of weeks, days, hours, minutes, and seconds between the two. The seconds field is optional, too. For an example, try entering your birthdate and compare it to today's date.

Title: Day of Week
Description: Calculate what day of the week a given date was. It works for leap years and also tells you whether the date is in the past, future, or today.

Title: Leap Year Calculator
Description: Is it a leap year? What about in 1900? Get your leap year facts straight with this leap year calculator. Just enter the year you are interested in and the script reports whether it is a leap year or not. Or, enter a range of years and JavaScript will display all the leap years in that range.

back to the top

--> Automotive/Travel/Distance

Title: Airport Calculator
Description: This useful JavaScript calculator will tell you the degrees, nautical miles, statute miles, and kilometers between your originating and destination airports. It includes a built-in database of over 150 of the most traveled airports!

Title: Distance Speed Time
Description: Calculate the time, distance, or speed given any two of the pieces of information.

Title: Driving Distance Calculator
Description: Use JavaScript to estimate the driving distance between U.S. cities.

back to the top

Title: Horsepower Calculator
Description: Enter your vehicle's quarter mile time (assuming you know it) and vehicle weight and this JavaScript program will display your car's estimated horsepower.

Title: Miles per Gallon
Description: Computes the miles per gallon of your car via the miles traveled and the number of gallons used. Also, if you enter the cost per gallon and how many miles you drive a day, it will estimate your monthly and yearly gas expenses.

Title: MPH to RPM Converter
Description: Ever wonder how fast your tires are rotating at a certain speed and at what G-force? This script will figure it out for you!

Title: Straight Distance
Description: Enter a coordinate pair for each the starting and ending points according to the Cartesian coodinate system. The script will calculate the straight line distance between the two points.

back to the top

--> Science

Title: Atmosphere Calculator
Description: JavaScript can help you do atmospheric computations.

Title: Kinetic Energy
Description: Solve any of three variables in a Kinetic Energy equation using this script. Simply enter two of the three values and submit to find the value of the third variable.

Title: Periodic Table
Description: Besides a very organized Periodic Table, this script will tell you lots of information about any periodic element you click on.

Title: Radioactive Calculator
Description: Use JavaScript to find how much radioactive material remains after a given time.

Title: Wind Chill Calculator

Description: Wind Chill is a mysterious and often misunderstood phenomenon. This script describes what the wind chill factor really is and offers a form to calculate the wind chill factor when given the air temperature and wind speed.

back to the top

--> Health/Anatomy

Title: Body Calculator
Description: This script uses some ingenious JavaScripting techniques. It analyzes a person's information (sex, height, weight) and responds with a comment message.

Title: Body Mass Index
Description: Just enter your height and your weight, and JavaScript will use a formula created by the Panel on Energy, Obesity, and Body Weight Standards to figure out your Body Mass Index. This index classifies you into one of several categories, from underweight to desirable to obese.

back to the top

Title: Calorie Calculator
Description: JavaScript can help you figure how many calories you have burned.

Title: Male Body Calculator
Description: Calculates a man's ideal body measurements based on his wrist circumference.

Title: Pregnancy Calculator
Contributor: Ronnie T. Moore
Description: Enter the mother's pregnancy information into this calculator and JavaScript will provide an estimated conception date, birth due date, and an estimated current fetal age. Great for all those mothers-to-be!

back to the top

--> Sports

Title: Lap Time
Description: Calculates the average lap split time required to finish a race in the time you enter.

Title: Playoff Chart Maker
Description: Enter the number of teams in your tournament and JavaScript will output the appropriate single-elimination playoff chart. Just print it out and fill it in to track your tournament.

Title: Running Calculator
Description: Allows runners to calculate their time, distance covered, or pace by entering the other two values. Distance and pace can be converted between various measurements. A great 3-in-1 script for runners!

back to the top

--> Web Design

Title: Download Calculator
Description: This calculator will help you estimate how long it will take to download a file at any of a number of modem speeds.

Title: Hex - RGB Converter
Description: Converts Hex to RGB and back in real time. Also displays current value as background color.

Title: RGB Slider
Description: Simple RGB to HEX color converter utilizing DHTML sliders.

back to the top

--> Radio/Acoustics/Music

Title: Beat Counter
Description: A manual Beats per Minute (BPM) counter for DJs or musicians. Counts the beats-per-minute of a song by tapping a key or the mouse to the beat of a song. Simply click on the page to start the time then tap any key to the beat.

Title: Wavelength Calculator
Description: Assists ham radio operators in converting a frequency to its wavelength in feet or inches. Other uses include acoustic measurement and adjustment, microphone placement, room tuning, and speaker positioning.

back to the top

--> Miscellaneous

Title: Ad Calculator
Description: Selling ad banners has just gotten easier! Just enter two of the three fields of information, such as the total cost, CPM (cost per thousand impressions), and exposures (number of ads shown), and the calculator will solve the last field for you.

Title: Armor Penetration Calculator
Description: JavaScript can help you figure armor penetration.

Title: ASCII Engine
Description: Enter any keyboard character and the ASCII Engine outputs the character's equivalent in ASCII Decimal, ASCII Hex, and even binary.

Title: Astrological Calculator
Description: A handy calculator that will calculate both your Western and Chinese birth signs. Enter the day, month, and year of your birth - or your date's - and instantly figure out if you (or they) are a Gemini born in the Year of the Ox, or a Year of the Rabbit/Cat Aquarius. The calculator will also return customizable funny messages if the user inputs an impossible date (e.g., February 30 or December 32).

back to the top

Title: Field Depth Calculator
Description: For all you photography enthusiasts out there, this script makes it a breeze to determine the field depth and amount that will be in focus in a photograph. Also includes other measurements such as nearest and furthest points of focus.

Title: GPA Calculator
Description: This is a very useful script to figure out your class GPA. Just enter the letter grade for each class.

Title: Paint Calculator
Description: This calculator can be used by painters to find out how much paint is needed to cover a given area. The calculator also has an advanced feature that will take the total of the width and height of doors and windows and subtract that measurement from the total area.

back to the top

Title: Phone Bill
Description: Ever wonder how much a long-distance phone call is going to cost, after you hung up? With this script, just enter the amount per minute, and any initial amount, then click start when the call begins and see the total charge at any time!

Title: Phone Number Converter
Description: Have you ever wondered if your phone number has a memorable text equivalent, like 555-HELP? Just type it in and this script will generate all possible combinations. Just pick your favorite one and tell the world how to reach you.

Title: Room Size Calculator
Description: Use JavaScript to find the approximate room size you'll need depending on your room setup and arrangement.

Title: World Population
Description: Estimates the current world population based on U.S. census data and the world growth rate. Not exactly precise, but neat anyway.

back to the top


Thank you to the following contributors for their JAVA expertise:
Steve Dulaney,Kenny Aral,Julian Rivera Pineda,Michael Hundt,Craig Blanchette ,David Sturgeon,Chris Brown,TJay Tipps,Nicholas John Sullivan ,Stephane Gamondes,Abraham I.,Adam Hinz,John T. Caranta III,Andreas Verhoeven,Tom Richardson Jr, Joey Mornin,Dan Kirkpatrick,John Caranta,Phil Pavlik,Adam Hinz,Mike Maloney ,Sam Tyler,Mike McGrath ,Charles Lucy,Jose Rodriguez Montoro,Gerald Schafer ,Paul Hartmann,Bryan Humphreys,Nic Wolfe,Bobby S. ,Ryan Sokol,Gordon Coverley,Ashley Steele,Dan Scott ,Michael C. Hundt ,Dev Pragad ,Ronnie T. Moore ,Anthony Louie ,Joe Josey,Gary Nicholson ,Joel Lavarez,Matthew Hoesch,James P. Dildine,Marat Rikelman and others.

Provided by: The School Resources Foundation, A National Heritage Foundation

  Copyright © 1999-2017 Learning By Grace and other copyright holders. All Rights Reserved. Private access to Learning By Grace online learning environment is subject to the terms and conditions in our Privacy Policy, Copyright Policy, Terms of Use Policy and rules and conditions detailed in our online home school website at Terms and conditions may change without notice and should be checked regularly for updates.