JavaScript - Calculator

Quick and easy calculator

Dec
Hex





Enter a numeric expression and press ENTER to calculate.

Get last result by pressing ENTER again.

Use TAB and SHIFT+TAB to jump between fields.

Use SHIFT+Arrows, CTRL+C and CTRL+V to mark, copy and paste.

Numeric Operators
+Addition
-Subtraction
*Multiplication
/Division
%Modulus
Bitwise Operators
&Bitwise logic AND
|Bitwise logic OR
^Bitwise logic XOR
~Bitwise logic NOT
<<Left shift
>>Signed right shift
>>>Unsigned right shift

Constants
EEuler's Number e, 2.7182…
LN2Natural log of 2, 0.6931…
LN10Natural log of 10, 2.3025…
LOG2EThe base 2 log of e, 1.4426…
LOG10EThe base 10 log of e, 0.4342…
PIArchimedes' Constant π, 3.1415…
SQRT1_2The square root of 1/2, 0.7071…
SQRT2The square root of 2, 1.4142…


Functions
abs(x)The absolute value of x 
acos(x)The arccosine in radians of x 
acosh(x)The area (inverse) hyperbolic cosine of x*
acot(x)The arccotangent in radians of x, PI/2 - atan(x) (0 < acot(x) < PI)*
acoth(x)The area (inverse) hyperbolic cotangent of x, atanh(1/x)*
acsc(x)The arccosecant in radians of x, asin(1/x)*
acsch(x)The area (inverse) hyperbolic cosecant of x, asinh(1/x)*
asec(x)The arcsecant in radians of x, acos(1/x)*
asech(x)The area (inverse) hyperbolic secant of x, acosh(1/x)*
asin(x)The arcsine in radians of x 
asinh(x)The area (inverse) hyperbolic sine of x*
atan(x)The arctangent in radians of x (-PI/2 < atan(x) < PI/2) 
atan2(y,x)The arctangent in radians of y/x (-PI < atan2(y,x) < PI) 
atanh(x)The area (inverse) hyperbolic tangent of x*
ceil(x)Round up to the nearest integer 
cos(x)The cosine of x in radians 
cosh(x)The hyperbolic cosine of x*
cot(x)The cotangent of x in radians, 1/tan(x)*
coth(x)The hyperbolic cotangent of x, 1/tanh(x)*
csc(x)The cosecant of x in radians, 1/sin(x)*
csch(x)The hyperbolic cosecant of x, 1/sinh(x)*
deg(x)Convert x from radians to degrees*
exp(x)e to the power of x, pow(E,x) 
fact(x)The factorial of x, x! = Γ(x+1)*
floor(x)Round down to the nearest integer 
gamma(x)The gamma of x, Γ(x) = (x-1)!*
log(x)The natural logarithm (base e) of x 
log10(x)The base 10 logarithm of x*
max(x,y)Gets the number with the highest value 
min(x,y)Gets the number with the lowest value 
pow(x,y)The value of x to the power of y 
rad(x)Convert x from degrees to radians*
random()Random number between 0 and 1 (0 ≤ random() < 1) 
round(x)Rounds x to the nearest integer 
sec(x)The secant of x in radians, 1/cos(x)*
sech(x)The hyperbolic secant of x, 1/cosh(x)*
sin(x)The sine of x in radians 
sinh(x)The hyperbolic sine of x*
sqrt(x)The square root of x 
tan(x)The tangent of x in radians 
tanh(x)The hyperbolic tangent of x*

* These functions are extensions to the standard functions in JavaScript.

This script will execute the user input as JavaScript code, using the eval() function. It is easy to "break" this page with malicious JavaScript code, but this will only affect the client browser itself.
WARNING! Your web browser does not support JavaScript or is outdated.
Copyright © 1996-2012 Scandinavian Digital Systems AB
Developed by Anders Danielsson using ASP.NET and C#