Learn Piano Game Play free
Home › Guides › Keyboards, MIDI and Bluetooth › How do you reduce keyboard lag in a web browser?

How do you reduce keyboard lag in a web browser?

Most browser lag comes from a wireless connection, Bluetooth headphones or a busy device. Switching to a USB cable, using wired headphones, using Chrome and closing other tabs fixes it for most people.

Keyboard lag is the gap between pressing a key and hearing or seeing something happen on screen. In a browser it usually comes from several small delays that add up: the wireless link, the browser itself, the sound output and a device that is working too hard. You can shrink most of them in about ten minutes, and you do not need new gear to start.

Work out which kind of delay you have

Before changing anything, notice what is late. The fix depends on it.

What you noticeLikely causeFirst thing to try
Sound comes late, but notes on screen react in timeBluetooth headphones or speakers, or slow audio outputSwitch to wired headphones or the keyboard's own speakers
On-screen notes react late, sound seems fineBrowser or device is busyClose tabs and other apps, use Chrome
Everything is late, and notes sometimes drop outBluetooth MIDI connectionTry a USB cable
Picture and sound are both slow and choppyWeak device or battery saving modePlug in the charger, close other apps

Here is a simple test. Tap one key at a steady pace and listen. If your keyboard's own sound is instant but the sound from the browser is late, the delay is somewhere in the browser chain, not in your keyboard.

Use a cable instead of Bluetooth when you can

A USB MIDI connection usually has less delay than Bluetooth MIDI, because wireless adds extra steps and can be disturbed by other signals. If your keyboard has a USB port that sends MIDI, a cable is the single most useful change. The guide on why there is delay with a Bluetooth piano explains the reasons in more detail.

If Bluetooth is your only option, keep the keyboard close to the device, and switch off other Bluetooth gadgets you are not using. Connect to one app at a time.

Make the browser's job easier

A browser has to run the page, read your MIDI messages and play sound, all at the same moment. Give it room.

For a deeper look at the MIDI side, the guide on fixing MIDI latency in a piano app covers more cases.

Choose how you listen

Sound is often the biggest source of delay, and people blame the keyboard when the real cause is the speakers. Bluetooth headphones and Bluetooth speakers commonly add a noticeable delay of their own. Wired headphones or wired speakers are the better choice for practice.

Another trick is to let the keyboard make the sound. Turn up the keyboard's built-in speakers or plug headphones into the keyboard, and lower the browser volume. You hear each note the instant you press it, and the screen only has to show what you played. If your keyboard has a setting called Local Control, leave it on. With it off, the keys stay silent until the computer sends the sound back, which adds delay.

Playing an acoustic piano with the microphone is a different case. The app has to listen, work out which note you played and then react, so a small delay is built in. A quiet room helps, and the microphone works best when the piano is close to it.

Fixes for phones and tablets

Phones and tablets have less spare power than computers, so the basics matter even more.

If the touch screen feels late, restart the browser first. Often that is all it takes.

When a little delay is normal

Some delay can never be removed completely, and a tiny one you cannot notice is fine. If a steady, small delay is left after the fixes above, your brain adjusts to it quickly. If it makes you late on every note, keep working on the fixes instead of fighting it with your hands.

You can also make practice forgiving while you sort it out. In Keyfall, Starter mode waits for you at the line and shows which key to press, so timing does not matter at all. You can also lower the speed in settings, which gives you more room for the odd late note. Keyfall is for practice and fun, so a perfect setup is not needed to learn from it.

If nothing helps, test a different browser, a different cable or a different device. Changing one thing at a time shows you where the delay lives.

More about keyboards, midi and bluetooth

61 keys or 88 keys: which should a beginner choose?What should you look for in headphones for a digital piano?What is the right keyboard stand and bench height for piano practice?Bluetooth MIDI vs USB MIDI: which should you use?Can you use Bluetooth headphones with a digital piano?Digital piano vs keyboard: which should a beginner buy?Do You Need a Driver for a USB MIDI Keyboard?Do you need a sustain pedal on a digital piano?

FAQ

Why is there lag when I play my keyboard in a browser?

Usually several small delays add up: the wireless connection, the browser, the sound output and a busy device. Bluetooth headphones are a very common cause that people overlook.

Is USB better than Bluetooth for piano lag?

Usually yes. USB MIDI tends to have less delay and fewer dropouts than Bluetooth MIDI, so use a cable when your keyboard supports it.

Which browser is best for playing piano games?

Chrome is the safest choice, because it supports Web MIDI, the feature keyboards use to connect. On iPhone and iPad, Bluetooth keyboards need the free Bluefy browser.

Why does the sound lag but the notes on screen do not?

The delay is probably in your audio output. Try wired headphones, or listen through the keyboard's own speakers and lower the browser volume.

Does the microphone have more lag than a MIDI keyboard?

It usually does, because the app has to listen and recognize the note before it can react. A quiet room and a microphone close to the piano help.

Can I still practice if some lag is left?

Yes. Use a mode that waits for you, like Starter mode in Keyfall, and lower the speed in settings. A small steady delay is not a reason to stop playing.

Practise it on your own piano. Keyfall is a free piano game: notes fall toward the keys and you play them on a digital piano, keyboard, phone or computer.

Play free