According to the UK's NHS (National Health Service), Ibuprofen is 'the preferred painkiller' for tooth infections. However, you may not be able to take it if you are pregnant or allergic to it. In that case, you can take paracetamol.