Online Tone Generator


I made an online tone generator based on the Firefox Audio API HTML5 Web Audio API. It’s basically a large logarithmic slider that allows real-time, smooth frequency changes. You can also fine-tune the frequency in 1 Hz increments, if necessary. (Update: You can also pick a music note from a list.)

There are other tone generators on the Web, but they are not as cool (if I do say so myself) and/or they require Java or Flash.

Warning: my generator only works on recent browsers which support the Web Audio API, such as Chrome and Firefox.

What can you use a tone generator for? You can do a science experiment with resonance, tune a musical instrument, test your new audio system (how low does it go?), test the limits of your hearing (I can hear absolutely nothing above 19,000 Hz, even at maximum volume), or figure out your tinnitus frequency to better target therapy.

About these ads

34 responses to “Online Tone Generator

  1. That’s why I love this blog: Tom always posts something cool. Thanks Tom!

  2. It’s bad luck for me. I use linux. :D grrr But it’s good toy. Nice one.

  3. So I try it in Ubuntu 12.04 with firefox 15.0 and it works propably bad. I listen good 20hz to 20173hz. Is it this bug? Does it give bad sound?

  4. It’s not working for me in Firefox 18 under Windows 7. The controls are there (minus the frequency number), but I can’t interact with them.

    • Thanks, fixed. There was a syntax error in the JS — I don’t know how I managed to upload a non-functional file — I always test my sites after I upload them to the server.

      Physics will never explain things like this.

  5. Have you thought of giving users the option to change the phase of the signal so that they could possibly reduce or cancel the sound from another device. I have tinnitus and would like to see if it is possible to use this method to reduce the level of the sound in my head.

  6. It works in Ubuntu 12.04 with Firefox 25.
    Nice job, thanks!

  7. Agreed, good stuff – very nice presentation, simple and easy-to-use.

    One request. Can you allow frequencies lower than 20Hz? I realize that drops below human hearing, but in terms of science, it makes for great woofer visuals.

    Along that line, have you considered having multiple simultaneous tone generators? Most of the sounds we hear (especially voice) are made of multiple frequencies. I would love to demonstrate to a class how sin waves destructively and constructively react to each other.

    Keep up the good work!

    • Charles,
      I’ve modified the scale to allow frequencies starting from 1 Hz.
      I imagine demonstrating constructive and destructive interference would take some thought to do right. You’d have to make it possible to manipulate the phase. Perhaps you could do your demonstration with Audacity?

      • Tomasz, that totally rocks – thanks for the quick turn around. So even though I cannot hear the actual frequency, I can hear the physical movement of the cone even down to 10Hz. Kinda cool. :)

  8. Best sound application EVER !!! Thanks!

  9. nice app. My wife is using it right now for her sinus infection. She is pressing a speaker into her cheek + eyebrow. Somewhere between 100-107hz seems to be the best to break up her mucous. We’ve read elsewhere that people do this and it clears up the sinus infection immediately. Fingers crossed.

  10. Nice and handy!

    Definitely works with FireFox v31.0 on Manjaro Linux installation.

    Would love to see how one can balance the volume based on the frequency as the higher frequencies often are louder than the lower frequencies. (Has to do with the lower losses of energy and shorter wavelengths.) – I used to know how to automatically adjust the volume via software (much like a compressor/compander would do in a circuit).


    I have made sure to bookmark this on the other part of the site. Seems that the saved-as-complete page also works well (for a locally-stored copy).

    Great idea.

    – Rev. Dragon’s Eye

  11. What about also displaying the pitch note for example A= 440 B= C= so on and so on. just the frequency is not enough. I have to keep searching for one of those now. by/

  12. This is a great tool. Is there a way to get the frequencies to a a couple of decimal places? I have been using it to tune the banjo, but it is hard to get the perfect frequency…. But then again, as they say, you can tune a Harley better than you can tune a banjo.

  13. Hi Tomasz, this is a great tool – nice work! I have a web audio question for you… What is the difference between Firefox and Chrome when it comes to changing oscillator frequency. Have you noticed that if you slide quickly in firefox the frequency-change isn’t smooth like it is in Chrome or Safari.

    I’ve been trying to fix something I made a while ago which doesn’t work properly on Firefox for that reason (

    Any help would be much appreciated. Thanks!

  14. Pretty-deaf Dave

    I was just now looking for a tone generator to test my hearing in a ~deaf ear and had imagined something like this one with a slider….and lo and behold, here it is and elegantly and simply implemented!! Thanks so much. This is a wonderful tool, and it turns out I can hear with that ear within a narrow range. Good to know this.

  15. I’ve been looking for a tone generator with a slider just like this to teach about tuning musical instruments. This is elegantly done, thank you!

  16. OK, now I’m getting more ideas! Can a volume control be added to this online tone generator? (I have no idea how hard that might be) So far I can open a couple of browser windows and play them at the same time to demonstrate intonation and beats, but I’d also really like to open several browser windows and set them to different overtones on the same fundamental, and adjust the volume so the fundamental is louder than its overtones… but then adjust the volume of different overtones to demonstrate what (for example) a clarinettist should be listening for in a rich, centered sound.

  17. Thanks – I really appreciate this thing.

  18. Just wanted to drop in and leave a word of thanks. I’m a science teacher and I’ve been using this online application for three years now to help with my unit on sound. It is EXACTLY what I needed to do some of our experiments. Thank you!

  19. Thanks for this – I’ve had tinnitus for a while, recently after snorkling and diving, my right ear is really bad. But I am struggling to find the frequency. When using it I do find that some frequencies I can’t actually hear as I scroll through – not sure if that is related? Anyway – thanks again for the tool even while I’m still trying to find my frequency :)

  20. Thanks for making this, I use it to localize the ‘hum’ I hear; it was consistently 66Hz but now varies between 59 and 72. At least I know it’ real now.

  21. Well done, thank you. Works in Opera 26.0 as well.

    Suggestion: I think would be better to make buttons (or single button) with changing color when generation is active. Right now if you click PLAY and you can not hear the sound (i.e. when the frequency is too low or too high to work on particular speakers) – there is no way to tell if generator is OFF or ON. This is quite confusing if you want to test working frequency range of output.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s