Use Your Browser's Address Bar As A Calculator, Without Google's Help

While Google can perform some simple calculations right from its home page, you can actually perform them with JavaScript in your address bar — no internet connection required.

Your address bar is useful for a lot of shortcuts, and using it as a calculator is a great one. However, Google can only perform certain simple calculations, and it requires that you actually load the Google page. If you want something quicker and more powerful, you can actually just use JavaScript. For example, to calculate 7*12, you would type:

javascript:7*12

into Firefox. In Chrome, the syntax is a bit different; you'd have to type:

javascript:alert(7*12)

You can just create search keywords for both of these (i.e. javascript:%s), so all you need to do is type, say, js 7*12 to get your answer.

What's really cool is that you can perform more complicated things, like exponents, square roots, trigonometric functions and more. Hit the link for more info, or check out Mozilla's documentation to see all that you can do with it.

Tip: Use JavaScript as a Calculator in Firefox and Chrome [2ality via Digital Inspiration]


Comments

    I'm sorry, I'm not even close to being a mathematician but I can just type in 7*12 enter, into the address bar to get 84 without the javascript prefix! admittedly my default search engine is Google... so why do I need to type in the javascript? I admit I'm prolly missing a point here, so can someone fill me in please!!

      It depends on your browser: if it's a newer one (e.g. Chrome) that defaults to searching with entered terms, then the calculation will work. However, even then the Javascript could be useful for more complex calculations which Google doesn't do.

    Thanks Angus, I should of mentioned which browser I'm using (FF) :)

Join the discussion!

Trending Stories Right Now